mirror of
https://github.com/denoland/deno.git
synced 2025-01-06 06:19:05 -05:00
core,cli: fix clippy warnings
This commit is contained in:
parent
e4354ce739
commit
8999517421
5 changed files with 10 additions and 13 deletions
|
@ -262,12 +262,9 @@ fn main() {
|
||||||
v8_set_flags(vec!["--help".to_string()]);
|
v8_set_flags(vec!["--help".to_string()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
match &flags.v8_flags {
|
if let Some(ref v8_flags) = flags.v8_flags {
|
||||||
Some(v8_flags) => {
|
|
||||||
v8_set_flags(v8_flags.clone());
|
v8_set_flags(v8_flags.clone());
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
};
|
|
||||||
|
|
||||||
log::set_max_level(if flags.log_debug {
|
log::set_max_level(if flags.log_debug {
|
||||||
LevelFilter::Debug
|
LevelFilter::Debug
|
||||||
|
|
|
@ -468,7 +468,7 @@ fn op_compiler_config(
|
||||||
let builder = &mut FlatBufferBuilder::new();
|
let builder = &mut FlatBufferBuilder::new();
|
||||||
let (path, out) = match get_compiler_config(state, compiler_type) {
|
let (path, out) = match get_compiler_config(state, compiler_type) {
|
||||||
Some(val) => val,
|
Some(val) => val,
|
||||||
_ => ("".to_owned(), "".as_bytes().to_owned()),
|
_ => ("".to_owned(), vec![]),
|
||||||
};
|
};
|
||||||
let data_off = builder.create_vector(&out);
|
let data_off = builder.create_vector(&out);
|
||||||
let msg_args = msg::CompilerConfigResArgs {
|
let msg_args = msg::CompilerConfigResArgs {
|
||||||
|
|
|
@ -50,9 +50,11 @@ pub enum StartupData<'a> {
|
||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DispatchFn = Fn(&[u8], Option<PinnedBuf>) -> Op;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
dispatch: Option<Arc<Fn(&[u8], Option<PinnedBuf>) -> Op>>,
|
dispatch: Option<Arc<DispatchFn>>,
|
||||||
pub will_snapshot: bool,
|
pub will_snapshot: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,7 @@ impl<L: Loader> Future for RecursiveLoad<L> {
|
||||||
modules.is_registered(&source_code_info.module_name)
|
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 {
|
if !is_module_registered {
|
||||||
let module_name = &source_code_info.module_name;
|
let module_name = &source_code_info.module_name;
|
||||||
|
@ -418,9 +418,7 @@ impl Modules {
|
||||||
let name = String::from(name);
|
let name = String::from(name);
|
||||||
debug!("register_complete {}", name);
|
debug!("register_complete {}", name);
|
||||||
|
|
||||||
let _r = self.by_name.insert(name.clone(), id);
|
self.by_name.insert(name.clone(), id);
|
||||||
// TODO should this be an assert or not ? assert!(r.is_none());
|
|
||||||
|
|
||||||
self.info.insert(
|
self.info.insert(
|
||||||
id,
|
id,
|
||||||
ModuleInfo {
|
ModuleInfo {
|
||||||
|
|
|
@ -95,7 +95,7 @@ impl SharedQueue {
|
||||||
|
|
||||||
fn num_shifted_off(&self) -> usize {
|
fn num_shifted_off(&self) -> usize {
|
||||||
let s = self.as_u32_slice();
|
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) {
|
fn set_end(&mut self, index: usize, end: usize) {
|
||||||
|
|
Loading…
Reference in a new issue