diff options
-rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
-rw-r--r-- | cli/diagnostics.rs | 2 | ||||
-rw-r--r-- | cli/file_watcher.rs | 2 | ||||
-rw-r--r-- | cli/fmt_errors.rs | 2 | ||||
-rw-r--r-- | cli/graph_util.rs | 6 | ||||
-rw-r--r-- | cli/lsp/completions.rs | 12 | ||||
-rw-r--r-- | cli/lsp/documents.rs | 4 | ||||
-rw-r--r-- | cli/tools/installer.rs | 8 | ||||
-rw-r--r-- | cli/tools/test.rs | 12 | ||||
-rw-r--r-- | core/error.rs | 1 | ||||
-rw-r--r-- | core/module_specifier.rs | 2 | ||||
-rw-r--r-- | ext/ffi/lib.rs | 4 | ||||
-rw-r--r-- | ext/websocket/lib.rs | 2 | ||||
-rw-r--r-- | runtime/inspector_server.rs | 8 | ||||
-rw-r--r-- | runtime/js.rs | 1 | ||||
-rw-r--r-- | runtime/permissions.rs | 6 | ||||
-rw-r--r-- | test_util/src/lib.rs | 1 |
17 files changed, 29 insertions, 46 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40a693aef..e08b4ca7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: - name: Install Rust uses: hecrj/setup-rust-action@v1 with: - rust-version: 1.57.0 + rust-version: 1.58.0 - name: Install clippy and rustfmt if: matrix.job == 'lint' diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index ff2b5dbb8..d49916f2d 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -409,7 +409,7 @@ impl fmt::Display for Diagnostics { if i > 0 { write!(f, "\n\n")?; } - write!(f, "{}", item.to_string())?; + write!(f, "{}", item)?; i += 1; } diff --git a/cli/file_watcher.rs b/cli/file_watcher.rs index 3b245e08f..87531bb77 100644 --- a/cli/file_watcher.rs +++ b/cli/file_watcher.rs @@ -60,7 +60,7 @@ where { let result = watch_future.await; if let Err(err) = result { - let msg = format!("{}: {}", colors::red_bold("error"), err.to_string(),); + let msg = format!("{}: {}", colors::red_bold("error"), err); eprintln!("{}", msg); } } diff --git a/cli/fmt_errors.rs b/cli/fmt_errors.rs index 126621279..b6e44ea07 100644 --- a/cli/fmt_errors.rs +++ b/cli/fmt_errors.rs @@ -81,7 +81,7 @@ fn format_frame(frame: &JsStackFrame) -> String { if frame.is_promise_all { result += &italic_bold(&format!( "Promise.all (index {})", - frame.promise_index.unwrap_or_default().to_string() + frame.promise_index.unwrap_or_default() )) .to_string(); return result; diff --git a/cli/graph_util.rs b/cli/graph_util.rs index d186a1ab1..efce57075 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -288,7 +288,7 @@ impl GraphData { if !range.specifier.as_str().contains("$deno") { return Some(Err(custom_error( get_error_class_name(&error.clone().into()), - format!("{}\n at {}", error.to_string(), range), + format!("{}\n at {}", error, range), ))); } return Some(Err(error.clone().into())); @@ -307,7 +307,7 @@ impl GraphData { if !range.specifier.as_str().contains("$deno") { return Some(Err(custom_error( get_error_class_name(&error.clone().into()), - format!("{}\n at {}", error.to_string(), range), + format!("{}\n at {}", error, range), ))); } return Some(Err(error.clone().into())); @@ -323,7 +323,7 @@ impl GraphData { if !range.specifier.as_str().contains("$deno") { return Some(Err(custom_error( get_error_class_name(&error.clone().into()), - format!("{}\n at {}", error.to_string(), range), + format!("{}\n at {}", error, range), ))); } return Some(Err(error.clone().into())); diff --git a/cli/lsp/completions.rs b/cli/lsp/completions.rs index 51a3ffb88..00d0631b8 100644 --- a/cli/lsp/completions.rs +++ b/cli/lsp/completions.rs @@ -428,18 +428,10 @@ fn relative_specifier( } } if parts.is_empty() { - format!( - "./{}{}", - last_a, - specifier[Position::AfterPath..].to_string() - ) + format!("./{}{}", last_a, &specifier[Position::AfterPath..]) } else { parts.push(last_a); - format!( - "{}{}", - parts.join("/"), - specifier[Position::AfterPath..].to_string() - ) + format!("{}{}", parts.join("/"), &specifier[Position::AfterPath..]) } } else { specifier[Position::BeforePath..].into() diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index b0da53ef3..280b345c7 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -588,8 +588,8 @@ pub(crate) fn to_hover_text( "blob" => "_(a blob url)_".to_string(), _ => format!( "{}​{}", - specifier[..url::Position::AfterScheme].to_string(), - specifier[url::Position::AfterScheme..].to_string() + &specifier[..url::Position::AfterScheme], + &specifier[url::Position::AfterScheme..], ) .replace('@', "​@"), }, diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 383bf74cf..e21e4954a 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -342,11 +342,11 @@ fn resolve_shim_data( } if let Some(inspect) = flags.inspect { - executable_args.push(format!("--inspect={}", inspect.to_string())); + executable_args.push(format!("--inspect={}", inspect)); } if let Some(inspect_brk) = flags.inspect_brk { - executable_args.push(format!("--inspect-brk={}", inspect_brk.to_string())); + executable_args.push(format!("--inspect-brk={}", inspect_brk)); } if let Some(import_map_path) = &flags.import_map_path { @@ -989,12 +989,12 @@ mod tests { let mut expected_string = format!( "--import-map '{}' 'http://localhost:4545/cat.ts'", - import_map_url.to_string() + import_map_url ); if cfg!(windows) { expected_string = format!( "\"--import-map\" \"{}\" \"http://localhost:4545/cat.ts\"", - import_map_url.to_string() + import_map_url ); } diff --git a/cli/tools/test.rs b/cli/tools/test.rs index d991ef1ec..5e2d74ecf 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -267,11 +267,7 @@ impl PrettyTestReporter { print!("{}", " ".repeat(description.level)); } - println!( - "{} {}", - status, - colors::gray(human_elapsed(elapsed.into())).to_string() - ); + println!("{} {}", status, colors::gray(human_elapsed(elapsed.into()))); if let Some(error_text) = result.error() { for line in error_text.lines() { @@ -357,11 +353,7 @@ impl TestReporter for PrettyTestReporter { print!(" "); } - println!( - "{} {}", - status, - colors::gray(human_elapsed(elapsed.into())).to_string() - ); + println!("{} {}", status, colors::gray(human_elapsed(elapsed.into()))); } fn report_step_wait(&mut self, description: &TestStepDescription) { diff --git a/core/error.rs b/core/error.rs index a462d3341..106845f04 100644 --- a/core/error.rs +++ b/core/error.rs @@ -372,6 +372,7 @@ impl ErrWithV8Handle { } } +#[allow(clippy::non_send_fields_in_send_ty)] unsafe impl Send for ErrWithV8Handle {} unsafe impl Sync for ErrWithV8Handle {} diff --git a/core/module_specifier.rs b/core/module_specifier.rs index 581249f9e..d09c4afb5 100644 --- a/core/module_specifier.rs +++ b/core/module_specifier.rs @@ -43,7 +43,7 @@ impl fmt::Display for ModuleResolutionError { specifier, match maybe_referrer { Some(referrer) => format!(" from \"{}\"", referrer), - None => format!(""), + None => String::new(), } ), } diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 8f06854d6..44f2e914e 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -57,6 +57,7 @@ struct Symbol { result_type: NativeType, } +#[allow(clippy::non_send_fields_in_send_ty)] unsafe impl Send for Symbol {} unsafe impl Sync for Symbol {} @@ -92,8 +93,7 @@ impl DynamicLibraryResource { Ok(value) => Ok(value), Err(err) => Err(generic_error(format!( "Failed to register symbol {}: {}", - symbol, - err.to_string() + symbol, err ))), }?; let ptr = libffi::middle::CodePtr::from_ptr(fn_ptr as _); diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 9358fb4b0..3384a8f9c 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -334,7 +334,7 @@ where .map_err(|err| { DomExceptionNetworkError::new(&format!( "failed to connect to WebSocket: {}", - err.to_string() + err )) })?; diff --git a/runtime/inspector_server.rs b/runtime/inspector_server.rs index 899e128c7..dde5cea02 100644 --- a/runtime/inspector_server.rs +++ b/runtime/inspector_server.rs @@ -152,11 +152,7 @@ fn handle_ws_request( _ => http::Response::builder() .status(http::StatusCode::BAD_REQUEST) .body("Not a valid Websocket Request".into()), - }); - - if resp.is_err() { - return resp; - } + })?; let (parts, _) = req.into_parts(); let req = http::Request::from_parts(parts, body); @@ -193,7 +189,7 @@ fn handle_ws_request( pump_websocket_messages(websocket, inbound_tx, outbound_rx).await; }); - resp + Ok(resp) } fn handle_json_request( diff --git a/runtime/js.rs b/runtime/js.rs index c259ff5ee..cdd479858 100644 --- a/runtime/js.rs +++ b/runtime/js.rs @@ -4,6 +4,7 @@ use log::debug; use once_cell::sync::Lazy; pub static CLI_SNAPSHOT: Lazy<Box<[u8]>> = Lazy::new( + #[allow(clippy::uninit_vec)] #[cold] #[inline(never)] || { diff --git a/runtime/permissions.rs b/runtime/permissions.rs index d4e1ec4f6..c404436d6 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -1918,7 +1918,7 @@ fn permission_prompt(message: &str) -> bool { if success != TRUE { panic!( "Error flushing console input buffer: {}", - std::io::Error::last_os_error().to_string() + std::io::Error::last_os_error() ) } } @@ -1941,7 +1941,7 @@ fn permission_prompt(message: &str) -> bool { if success != TRUE { panic!( "Error emulating enter key press: {}", - std::io::Error::last_os_error().to_string() + std::io::Error::last_os_error() ) } } @@ -1954,7 +1954,7 @@ fn permission_prompt(message: &str) -> bool { if success != TRUE { panic!( "Error peeking console input buffer: {}", - std::io::Error::last_os_error().to_string() + std::io::Error::last_os_error() ) } events_read == 0 diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 9eb58d91a..6182622c9 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -956,6 +956,7 @@ impl hyper::server::accept::Accept for HyperAcceptor<'_> { } } +#[allow(clippy::non_send_fields_in_send_ty)] unsafe impl std::marker::Send for HyperAcceptor<'_> {} async fn wrap_redirect_server() { |