Skip to content

Commit

Permalink
src: simplify rust code
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Feb 1, 2019
1 parent 7d994c2 commit e5899b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ impl Isolate {
) -> Result<(), RustOrJsError> {
// basically iterate over the imports, start loading them.

let referrer = self.modules.get(&id).unwrap().clone();
let referrer = &self.modules[&id];
let referrer_name = referrer.name.clone();
let len =
unsafe { libdeno::deno_mod_imports_len(self.libdeno_isolate, id) };
Expand Down Expand Up @@ -532,7 +532,7 @@ extern "C" fn resolve_cb(
let isolate = unsafe { Isolate::from_raw_ptr(user_data) };
let specifier_c: &CStr = unsafe { CStr::from_ptr(specifier_ptr) };
let specifier: &str = specifier_c.to_str().unwrap();
return isolate.resolve_cb(specifier, referrer);
isolate.resolve_cb(specifier, referrer)
}

// Dereferences the C pointer into the Rust Isolate object.
Expand Down
2 changes: 1 addition & 1 deletion src/tokio_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Future for Accept {
}
Err(e) => {
r.untrack_task();
return Err(From::from(e));
return Err(e);
}
},
AcceptState::Empty => panic!("poll Accept after it's done"),
Expand Down

0 comments on commit e5899b1

Please sign in to comment.