diff --git a/cli/emit.rs b/cli/emit.rs index c7a31fc0f9..584593869e 100644 --- a/cli/emit.rs +++ b/cli/emit.rs @@ -38,7 +38,6 @@ use deno_graph::ModuleKind; use deno_graph::ResolutionError; use std::collections::HashSet; use std::fmt; -use std::result; use std::sync::Arc; use std::time::Instant; @@ -47,7 +46,7 @@ use std::time::Instant; pub struct Stats(pub Vec<(String, u32)>); impl<'de> Deserialize<'de> for Stats { - fn deserialize(deserializer: D) -> result::Result + fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { diff --git a/cli/file_watcher.rs b/cli/file_watcher.rs index 60627548e0..0f9f7d1ff0 100644 --- a/cli/file_watcher.rs +++ b/cli/file_watcher.rs @@ -32,7 +32,7 @@ struct DebouncedReceiver { // and so we store this state on the struct to ensure we don't // lose items if a `recv()` never completes received_items: HashSet, - receiver: mpsc::UnboundedReceiver>, + receiver: UnboundedReceiver>, } impl DebouncedReceiver { @@ -55,7 +55,7 @@ impl DebouncedReceiver { } loop { - tokio::select! { + select! { items = self.receiver.recv() => { self.received_items.extend(items?); } @@ -255,7 +255,7 @@ where /// changes. For example, in the case where we would like to bundle, then `operation` would /// have the logic for it like bundling the code. pub async fn watch_func2( - mut paths_to_watch_receiver: mpsc::UnboundedReceiver>, + mut paths_to_watch_receiver: UnboundedReceiver>, mut operation: O, operation_args: T, print_config: PrintConfig, diff --git a/cli/fmt_errors.rs b/cli/fmt_errors.rs index 759850cecc..53cf975bc3 100644 --- a/cli/fmt_errors.rs +++ b/cli/fmt_errors.rs @@ -127,7 +127,7 @@ fn format_maybe_source_line( if column_number as usize > source_line.len() { return format!( "\n{} Couldn't format source line: Column {} is out of bounds (source may have changed at runtime)", - crate::colors::yellow("Warning"), column_number, + yellow("Warning"), column_number, ); } diff --git a/cli/fs_util.rs b/cli/fs_util.rs index 53406351b5..322b3f9e74 100644 --- a/cli/fs_util.rs +++ b/cli/fs_util.rs @@ -249,7 +249,7 @@ where { let mut prepared = vec![]; - let root_path = std::env::current_dir()?; + let root_path = current_dir()?; for path in include { let lowercase_path = path.to_lowercase(); if lowercase_path.starts_with("http://") diff --git a/cli/main.rs b/cli/main.rs index 2cdd65ed21..55416e0e40 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -175,7 +175,7 @@ fn create_web_worker_callback( source_map_getter: Some(Box::new(ps.clone())), worker_type: args.worker_type, maybe_inspector_server, - get_error_class_fn: Some(&crate::errors::get_error_class_name), + get_error_class_fn: Some(&errors::get_error_class_name), blob_store: ps.blob_store.clone(), broadcast_channel: ps.broadcast_channel.clone(), shared_array_buffer_store: Some(ps.shared_array_buffer_store.clone()), @@ -255,7 +255,7 @@ pub fn create_main_worker( maybe_inspector_server, should_break_on_first_statement, module_loader, - get_error_class_fn: Some(&crate::errors::get_error_class_name), + get_error_class_fn: Some(&errors::get_error_class_name), origin_storage_dir, blob_store: ps.blob_store.clone(), broadcast_channel: ps.broadcast_channel.clone(), @@ -363,23 +363,23 @@ fn print_cache_info( pub fn get_types(unstable: bool) -> String { let mut types = vec![ - crate::tsc::DENO_NS_LIB, - crate::tsc::DENO_CONSOLE_LIB, - crate::tsc::DENO_URL_LIB, - crate::tsc::DENO_WEB_LIB, - crate::tsc::DENO_FETCH_LIB, - crate::tsc::DENO_WEBGPU_LIB, - crate::tsc::DENO_WEBSOCKET_LIB, - crate::tsc::DENO_WEBSTORAGE_LIB, - crate::tsc::DENO_CRYPTO_LIB, - crate::tsc::DENO_BROADCAST_CHANNEL_LIB, - crate::tsc::DENO_NET_LIB, - crate::tsc::SHARED_GLOBALS_LIB, - crate::tsc::WINDOW_LIB, + tsc::DENO_NS_LIB, + tsc::DENO_CONSOLE_LIB, + tsc::DENO_URL_LIB, + tsc::DENO_WEB_LIB, + tsc::DENO_FETCH_LIB, + tsc::DENO_WEBGPU_LIB, + tsc::DENO_WEBSOCKET_LIB, + tsc::DENO_WEBSTORAGE_LIB, + tsc::DENO_CRYPTO_LIB, + tsc::DENO_BROADCAST_CHANNEL_LIB, + tsc::DENO_NET_LIB, + tsc::SHARED_GLOBALS_LIB, + tsc::WINDOW_LIB, ]; if unstable { - types.push(crate::tsc::UNSTABLE_NS_LIB); + types.push(tsc::UNSTABLE_NS_LIB); } types.join("\n") @@ -1317,13 +1317,9 @@ fn setup_panic_hook() { eprintln!("reproduction steps and re-run with the RUST_BACKTRACE=1 env"); eprintln!("var set and include the backtrace in your report."); eprintln!(); - eprintln!( - "Platform: {} {}", - std::env::consts::OS, - std::env::consts::ARCH - ); + eprintln!("Platform: {} {}", env::consts::OS, env::consts::ARCH); eprintln!("Version: {}", version::deno()); - eprintln!("Args: {:?}", std::env::args().collect::>()); + eprintln!("Args: {:?}", env::args().collect::>()); eprintln!(); orig_hook(panic_info); std::process::exit(1); diff --git a/cli/proc_state.rs b/cli/proc_state.rs index ae0290b2c7..bb51b6f1a9 100644 --- a/cli/proc_state.rs +++ b/cli/proc_state.rs @@ -421,7 +421,7 @@ impl ProcState { self.options.resolve_ts_config_for_emit(config_type)?; if let Some(ignored_options) = ts_config_result.maybe_ignored_options { - log::warn!("{}", ignored_options); + warn!("{}", ignored_options); } // start type checking if necessary @@ -626,7 +626,7 @@ impl ProcState { }; Ok( - deno_graph::create_graph( + create_graph( roots, false, maybe_imports, diff --git a/cli/standalone.rs b/cli/standalone.rs index cd5390d2de..72b9b5ef73 100644 --- a/cli/standalone.rs +++ b/cli/standalone.rs @@ -274,7 +274,7 @@ pub async fn run( cpu_count: std::thread::available_parallelism() .map(|p| p.get()) .unwrap_or(1), - debug_flag: metadata.log_level.map_or(false, |l| l == log::Level::Debug), + debug_flag: metadata.log_level.map_or(false, |l| l == Level::Debug), enable_testing_features: false, location: metadata.location, no_color: !colors::use_color(), diff --git a/cli/tsc.rs b/cli/tsc.rs index e3001583bd..633b4cd30d 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -798,7 +798,7 @@ mod tests { #[test] fn test_compiler_snapshot() { - let mut js_runtime = deno_core::JsRuntime::new(deno_core::RuntimeOptions { + let mut js_runtime = JsRuntime::new(RuntimeOptions { startup_snapshot: Some(compiler_snapshot()), ..Default::default() });