diff options
Diffstat (limited to 'src/ops.rs')
-rw-r--r-- | src/ops.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/ops.rs b/src/ops.rs index a0761fc84..26d9b1e5e 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -330,7 +330,7 @@ fn op_set_timeout( ) -> Box<Op> { assert_eq!(data.len(), 0); let inner = base.inner_as_set_timeout().unwrap(); - // FIXME why is timeout a double if it's cast immediately to i64? + // FIXME why is timeout a double if it's cast immediately to i64/u64?? let val = inner.timeout() as i64; isolate.timeout_due = if val >= 0 { Some(Instant::now() + Duration::from_millis(val as u64)) @@ -400,7 +400,7 @@ fn op_fetch( assert!(header.is_request()); let url = header.url().unwrap(); - let body = if data.len() == 0 { + let body = if data.is_empty() { hyper::Body::empty() } else { hyper::Body::from(Vec::from(data)) @@ -429,7 +429,6 @@ fn op_fetch( &msg::FetchResArgs { header: Some(header_off), body_rid: body_resource.rid, - ..Default::default() }, ); @@ -1377,19 +1376,19 @@ fn op_run( let args = inner.args().unwrap(); let cwd = inner.cwd(); - let mut cmd = Command::new(args.get(0)); + let mut c = Command::new(args.get(0)); (1..args.len()).for_each(|i| { let arg = args.get(i); - cmd.arg(arg); + c.arg(arg); }); - cwd.map(|d| cmd.current_dir(d)); + cwd.map(|d| c.current_dir(d)); - cmd.stdin(subprocess_stdio_map(inner.stdin())); - cmd.stdout(subprocess_stdio_map(inner.stdout())); - cmd.stderr(subprocess_stdio_map(inner.stderr())); + c.stdin(subprocess_stdio_map(inner.stdin())); + c.stdout(subprocess_stdio_map(inner.stdout())); + c.stderr(subprocess_stdio_map(inner.stderr())); // Spawn the command. - let child = match cmd.spawn_async() { + let child = match c.spawn_async() { Ok(v) => v, Err(err) => { return odd_future(err.into()); @@ -1469,7 +1468,6 @@ fn op_run_status( got_signal, exit_code: code.unwrap_or(-1), exit_signal: signal.unwrap_or(-1), - ..Default::default() }, ); Ok(serialize_response( |