@@ -92,7 +92,7 @@ impl<J: 'static + AsyncJob> AsyncSingleJob<J> {
9292 }
9393
9494 /// makes sure `next` is cleared and returns `true` if it actually canceled something
95- pub fn cancel ( & mut self ) -> bool {
95+ pub fn cancel ( & self ) -> bool {
9696 if let Ok ( mut next) = self . next . lock ( ) {
9797 if next. is_some ( ) {
9898 * next = None ;
@@ -111,7 +111,7 @@ impl<J: 'static + AsyncJob> AsyncSingleJob<J> {
111111 /// spawns `task` if nothing is running currently,
112112 /// otherwise schedules as `next` overwriting if `next` was set before.
113113 /// return `true` if the new task gets started right away.
114- pub fn spawn ( & mut self , task : J ) -> bool {
114+ pub fn spawn ( & self , task : J ) -> bool {
115115 self . schedule_next ( task) ;
116116 self . check_for_job ( )
117117 }
@@ -162,7 +162,7 @@ impl<J: 'static + AsyncJob> AsyncSingleJob<J> {
162162 Ok ( ( ) )
163163 }
164164
165- fn schedule_next ( & mut self , task : J ) {
165+ fn schedule_next ( & self , task : J ) {
166166 if let Ok ( mut next) = self . next . lock ( ) {
167167 * next = Some ( task) ;
168168 }
@@ -226,7 +226,7 @@ mod test {
226226 fn test_overwrite ( ) {
227227 let ( sender, receiver) = unbounded ( ) ;
228228
229- let mut job: AsyncSingleJob < TestJob > =
229+ let job: AsyncSingleJob < TestJob > =
230230 AsyncSingleJob :: new ( sender) ;
231231
232232 let task = TestJob {
@@ -265,7 +265,7 @@ mod test {
265265 fn test_cancel ( ) {
266266 let ( sender, receiver) = unbounded ( ) ;
267267
268- let mut job: AsyncSingleJob < TestJob > =
268+ let job: AsyncSingleJob < TestJob > =
269269 AsyncSingleJob :: new ( sender) ;
270270
271271 let task = TestJob {
0 commit comments