Skip to content

Commit 2ed00ff

Browse files
olsonjefferybrson
authored andcommitted
core: change notify_chan eq checks to is_none(), instead
1 parent 02ddbad commit 2ed00ff

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/libcore/task.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,13 @@ fn task() -> TaskBuilder {
246246
mut consumed: false,
247247
})
248248
}
249-
250249
priv impl TaskBuilder {
251250
fn consume() -> TaskBuilder {
252251
if self.consumed {
253252
fail ~"Cannot copy a task_builder"; // Fake move mode on self
254253
}
255254
self.consumed = true;
256-
let notify_chan = if self.opts.notify_chan == None {
255+
let notify_chan = if self.opts.notify_chan.is_none() {
257256
None
258257
} else {
259258
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -278,7 +277,7 @@ impl TaskBuilder {
278277
* the other will not be killed.
279278
*/
280279
fn unlinked() -> TaskBuilder {
281-
let notify_chan = if self.opts.notify_chan == None {
280+
let notify_chan = if self.opts.notify_chan.is_none() {
282281
None
283282
} else {
284283
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -300,7 +299,7 @@ impl TaskBuilder {
300299
* the child.
301300
*/
302301
fn supervised() -> TaskBuilder {
303-
let notify_chan = if self.opts.notify_chan == None {
302+
let notify_chan = if self.opts.notify_chan.is_none() {
304303
None
305304
} else {
306305
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -321,7 +320,7 @@ impl TaskBuilder {
321320
* other will be killed.
322321
*/
323322
fn linked() -> TaskBuilder {
324-
let notify_chan = if self.opts.notify_chan == None {
323+
let notify_chan = if self.opts.notify_chan.is_none() {
325324
None
326325
} else {
327326
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -388,7 +387,7 @@ impl TaskBuilder {
388387
}
389388
/// Configure a custom scheduler mode for the task.
390389
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() {
392391
None
393392
} else {
394393
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -419,7 +418,7 @@ impl TaskBuilder {
419418
*/
420419
fn add_wrapper(wrapper: fn@(+fn~()) -> fn~()) -> TaskBuilder {
421420
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() {
423422
None
424423
} else {
425424
Some(option::swap_unwrap(&mut self.opts.notify_chan))
@@ -450,7 +449,7 @@ impl TaskBuilder {
450449
* must be greater than zero.
451450
*/
452451
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() {
454453
None
455454
} else {
456455
let swapped_notify_chan =
@@ -1267,7 +1266,7 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
12671266
};
12681267
assert !new_task.is_null();
12691268
// 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() {
12711270
None
12721271
} else {
12731272
Some(option::swap_unwrap(&mut opts.notify_chan))

0 commit comments

Comments
 (0)