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

chore: update Rust to 1.68.0 (#18102)

This commit is contained in:
Bartek Iwańczuk 2023-03-09 15:18:00 -04:00 committed by GitHub
parent 8f207c0f3f
commit bb07e230d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 26 deletions

View file

@ -261,19 +261,14 @@ impl TestOptions {
} }
} }
#[derive(Clone, Debug)] #[derive(Clone, Default, Debug)]
pub enum LintReporterKind { pub enum LintReporterKind {
#[default]
Pretty, Pretty,
Json, Json,
Compact, Compact,
} }
impl Default for LintReporterKind {
fn default() -> Self {
LintReporterKind::Pretty
}
}
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct LintOptions { pub struct LintOptions {
pub rules: LintRulesConfig, pub rules: LintRulesConfig,

View file

@ -2408,14 +2408,14 @@ fn napi_set_element(
fn napi_set_instance_data( fn napi_set_instance_data(
env: *mut Env, env: *mut Env,
data: *mut c_void, data: *mut c_void,
finalize_cb: napi_finalize, finalize_cb: Option<napi_finalize>,
finalize_hint: *mut c_void, finalize_hint: *mut c_void,
) -> Result { ) -> Result {
let env = &mut *(env as *mut Env); let env = &mut *(env as *mut Env);
let shared = env.shared_mut(); let shared = env.shared_mut();
shared.instance_data = data; shared.instance_data = data;
shared.data_finalize = if !(finalize_cb as *const c_void).is_null() { shared.data_finalize = if finalize_cb.is_some() {
Some(finalize_cb) finalize_cb
} else { } else {
None None
}; };

View file

@ -388,7 +388,6 @@ fn resolve_bin_entry_value<'a>(
.as_object() .as_object()
.map(|o| { .map(|o| {
o.keys() o.keys()
.into_iter()
.map(|k| format!(" * npm:{pkg_nv}/{k}")) .map(|k| format!(" * npm:{pkg_nv}/{k}"))
.collect::<Vec<_>>() .collect::<Vec<_>>()
}) })

View file

@ -672,7 +672,6 @@ fn abbreviate_test_error(js_error: &JsError) -> JsError {
false false
} }
}) })
.into_iter()
.collect::<Vec<_>>(); .collect::<Vec<_>>();
frames.reverse(); frames.reverse();
js_error.frames = frames; js_error.frames = frames;

View file

@ -326,7 +326,7 @@ fn rss() -> usize {
} }
for n in chars { for n in chars {
idx += 1; idx += 1;
if ('0'..='9').contains(&n) { if n.is_ascii_digit() {
out *= 10; out *= 10;
out += n as usize - '0' as usize; out += n as usize - '0' as usize;
} else { } else {

View file

@ -38,9 +38,12 @@ static DEBUG_LOG_ENABLED: Lazy<bool> =
Lazy::new(|| log::log_enabled!(log::Level::Debug)); Lazy::new(|| log::log_enabled!(log::Level::Debug));
/// Tri-state value for storing permission state /// Tri-state value for storing permission state
#[derive(Eq, PartialEq, Debug, Clone, Copy, Deserialize, PartialOrd)] #[derive(
Eq, PartialEq, Default, Debug, Clone, Copy, Deserialize, PartialOrd,
)]
pub enum PermissionState { pub enum PermissionState {
Granted = 0, Granted = 0,
#[default]
Prompt = 1, Prompt = 1,
Denied = 2, Denied = 2,
} }
@ -140,12 +143,6 @@ impl fmt::Display for PermissionState {
} }
} }
impl Default for PermissionState {
fn default() -> Self {
PermissionState::Prompt
}
}
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct UnitPermission { pub struct UnitPermission {
pub name: &'static str, pub name: &'static str,

View file

@ -1,3 +1,3 @@
[toolchain] [toolchain]
channel = "1.67.0" channel = "1.68.0"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]

View file

@ -344,16 +344,13 @@ async fn run_ws_close_server(addr: &SocketAddr) {
} }
} }
#[derive(Default)]
enum SupportedHttpVersions { enum SupportedHttpVersions {
#[default]
All, All,
Http1Only, Http1Only,
Http2Only, Http2Only,
} }
impl Default for SupportedHttpVersions {
fn default() -> SupportedHttpVersions {
SupportedHttpVersions::All
}
}
async fn get_tls_config( async fn get_tls_config(
cert: &str, cert: &str,