summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/main.rs9
-rw-r--r--cli/ops.rs2
-rw-r--r--core/isolate.rs4
-rw-r--r--core/modules.rs6
-rw-r--r--core/shared_queue.rs2
5 files changed, 10 insertions, 13 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 4632d15e4..c601c00b1 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -262,12 +262,9 @@ fn main() {
v8_set_flags(vec!["--help".to_string()]);
}
- match &flags.v8_flags {
- Some(v8_flags) => {
- v8_set_flags(v8_flags.clone());
- }
- _ => {}
- };
+ if let Some(ref v8_flags) = flags.v8_flags {
+ v8_set_flags(v8_flags.clone());
+ }
log::set_max_level(if flags.log_debug {
LevelFilter::Debug
diff --git a/cli/ops.rs b/cli/ops.rs
index c49ce517c..4c644714f 100644
--- a/cli/ops.rs
+++ b/cli/ops.rs
@@ -468,7 +468,7 @@ fn op_compiler_config(
let builder = &mut FlatBufferBuilder::new();
let (path, out) = match get_compiler_config(state, compiler_type) {
Some(val) => val,
- _ => ("".to_owned(), "".as_bytes().to_owned()),
+ _ => ("".to_owned(), vec![]),
};
let data_off = builder.create_vector(&out);
let msg_args = msg::CompilerConfigResArgs {
diff --git a/core/isolate.rs b/core/isolate.rs
index 96d9dc24b..b51b7fe47 100644
--- a/core/isolate.rs
+++ b/core/isolate.rs
@@ -50,9 +50,11 @@ pub enum StartupData<'a> {
None,
}
+type DispatchFn = Fn(&[u8], Option<PinnedBuf>) -> Op;
+
#[derive(Default)]
pub struct Config {
- dispatch: Option<Arc<Fn(&[u8], Option<PinnedBuf>) -> Op>>,
+ dispatch: Option<Arc<DispatchFn>>,
pub will_snapshot: bool,
}
diff --git a/core/modules.rs b/core/modules.rs
index c634a5aa6..0e7cc68aa 100644
--- a/core/modules.rs
+++ b/core/modules.rs
@@ -200,7 +200,7 @@ impl<L: Loader> Future for RecursiveLoad<L> {
modules.is_registered(&source_code_info.module_name)
};
- let need_alias = &source_code_info.module_name != &completed.url;
+ let need_alias = source_code_info.module_name != completed.url;
if !is_module_registered {
let module_name = &source_code_info.module_name;
@@ -418,9 +418,7 @@ impl Modules {
let name = String::from(name);
debug!("register_complete {}", name);
- let _r = self.by_name.insert(name.clone(), id);
- // TODO should this be an assert or not ? assert!(r.is_none());
-
+ self.by_name.insert(name.clone(), id);
self.info.insert(
id,
ModuleInfo {
diff --git a/core/shared_queue.rs b/core/shared_queue.rs
index af19cfc6f..c33a37b90 100644
--- a/core/shared_queue.rs
+++ b/core/shared_queue.rs
@@ -95,7 +95,7 @@ impl SharedQueue {
fn num_shifted_off(&self) -> usize {
let s = self.as_u32_slice();
- return s[INDEX_NUM_SHIFTED_OFF] as usize;
+ s[INDEX_NUM_SHIFTED_OFF] as usize
}
fn set_end(&mut self, index: usize, end: usize) {