1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-31 11:34:15 -05:00

core,cli: fix clippy warnings

This commit is contained in:
Bert Belder 2019-05-03 02:37:02 +02:00
parent e4354ce739
commit 8999517421
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
5 changed files with 10 additions and 13 deletions

View file

@ -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

View file

@ -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 {

View file

@ -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,
}

View file

@ -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 {

View file

@ -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) {