@@ -246,14 +246,13 @@ fn task() -> TaskBuilder {
246
246
mut consumed: false,
247
247
} )
248
248
}
249
-
250
249
priv impl TaskBuilder {
251
250
fn consume ( ) -> TaskBuilder {
252
251
if self . consumed {
253
252
fail ~"Cannot copy a task_builder"; // Fake move mode on self
254
253
}
255
254
self . consumed = true ;
256
- let notify_chan = if self . opts . notify_chan == None {
255
+ let notify_chan = if self . opts . notify_chan . is_none ( ) {
257
256
None
258
257
} else {
259
258
Some ( option:: swap_unwrap ( & mut self . opts . notify_chan ) )
@@ -278,7 +277,7 @@ impl TaskBuilder {
278
277
* the other will not be killed.
279
278
*/
280
279
fn unlinked ( ) -> TaskBuilder {
281
- let notify_chan = if self . opts . notify_chan == None {
280
+ let notify_chan = if self . opts . notify_chan . is_none ( ) {
282
281
None
283
282
} else {
284
283
Some ( option:: swap_unwrap ( & mut self . opts . notify_chan ) )
@@ -300,7 +299,7 @@ impl TaskBuilder {
300
299
* the child.
301
300
*/
302
301
fn supervised ( ) -> TaskBuilder {
303
- let notify_chan = if self . opts . notify_chan == None {
302
+ let notify_chan = if self . opts . notify_chan . is_none ( ) {
304
303
None
305
304
} else {
306
305
Some ( option:: swap_unwrap ( & mut self . opts . notify_chan ) )
@@ -321,7 +320,7 @@ impl TaskBuilder {
321
320
* other will be killed.
322
321
*/
323
322
fn linked ( ) -> TaskBuilder {
324
- let notify_chan = if self . opts . notify_chan == None {
323
+ let notify_chan = if self . opts . notify_chan . is_none ( ) {
325
324
None
326
325
} else {
327
326
Some ( option:: swap_unwrap ( & mut self . opts . notify_chan ) )
@@ -388,7 +387,7 @@ impl TaskBuilder {
388
387
}
389
388
/// Configure a custom scheduler mode for the task.
390
389
fn sched_mode(mode: SchedMode) -> TaskBuilder {
391
- let notify_chan = if self.opts.notify_chan == None {
390
+ let notify_chan = if self.opts.notify_chan.is_none() {
392
391
None
393
392
} else {
394
393
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -419,7 +418,7 @@ impl TaskBuilder {
419
418
*/
420
419
fn add_wrapper(wrapper: fn@(+fn~()) -> fn~()) -> TaskBuilder {
421
420
let prev_gen_body = self.gen_body;
422
- let notify_chan = if self.opts.notify_chan == None {
421
+ let notify_chan = if self.opts.notify_chan.is_none() {
423
422
None
424
423
} else {
425
424
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -450,7 +449,7 @@ impl TaskBuilder {
450
449
* must be greater than zero.
451
450
*/
452
451
fn spawn(+f: fn~()) {
453
- let notify_chan = if self.opts.notify_chan == None {
452
+ let notify_chan = if self.opts.notify_chan.is_none() {
454
453
None
455
454
} else {
456
455
let swapped_notify_chan =
@@ -1267,7 +1266,7 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
1267
1266
} ;
1268
1267
assert !new_task. is_null( ) ;
1269
1268
// Getting killed after here would leak the task.
1270
- let mut notify_chan = if opts. notify_chan == None {
1269
+ let mut notify_chan = if opts. notify_chan. is_none ( ) {
1271
1270
None
1272
1271
} else {
1273
1272
Some ( option:: swap_unwrap( & mut opts. notify_chan) )
0 commit comments