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

chore: upgrade to rust 1.58 (#13377)

This commit is contained in:
David Sherret 2022-01-15 01:10:12 -05:00 committed by GitHub
parent 903cb48fe9
commit ad224f53c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 29 additions and 46 deletions

View file

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

View file

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

View file

@ -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);
}
}

View file

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

View file

@ -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()));

View file

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

View file

@ -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('@', "​@"),
},

View file

@ -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
);
}

View file

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

View file

@ -372,6 +372,7 @@ impl ErrWithV8Handle {
}
}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl Send for ErrWithV8Handle {}
unsafe impl Sync for ErrWithV8Handle {}

View file

@ -43,7 +43,7 @@ impl fmt::Display for ModuleResolutionError {
specifier,
match maybe_referrer {
Some(referrer) => format!(" from \"{}\"", referrer),
None => format!(""),
None => String::new(),
}
),
}

View file

@ -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 _);

View file

@ -334,7 +334,7 @@ where
.map_err(|err| {
DomExceptionNetworkError::new(&format!(
"failed to connect to WebSocket: {}",
err.to_string()
err
))
})?;

View file

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

View file

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

View file

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

View file

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