Skip to content

Commit

Permalink
chore: update Rust to 1.68.0 (denoland#18102)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Mar 9, 2023
1 parent 8f207c0 commit bb07e23
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 26 deletions.
9 changes: 2 additions & 7 deletions cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,14 @@ impl TestOptions {
}
}

#[derive(Clone, Debug)]
#[derive(Clone, Default, Debug)]
pub enum LintReporterKind {
#[default]
Pretty,
Json,
Compact,
}

impl Default for LintReporterKind {
fn default() -> Self {
LintReporterKind::Pretty
}
}

#[derive(Clone, Debug, Default)]
pub struct LintOptions {
pub rules: LintRulesConfig,
Expand Down
6 changes: 3 additions & 3 deletions cli/napi/js_native_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2408,14 +2408,14 @@ fn napi_set_element(
fn napi_set_instance_data(
env: *mut Env,
data: *mut c_void,
finalize_cb: napi_finalize,
finalize_cb: Option<napi_finalize>,
finalize_hint: *mut c_void,
) -> Result {
let env = &mut *(env as *mut Env);
let shared = env.shared_mut();
shared.instance_data = data;
shared.data_finalize = if !(finalize_cb as *const c_void).is_null() {
Some(finalize_cb)
shared.data_finalize = if finalize_cb.is_some() {
finalize_cb
} else {
None
};
Expand Down
1 change: 0 additions & 1 deletion cli/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ fn resolve_bin_entry_value<'a>(
.as_object()
.map(|o| {
o.keys()
.into_iter()
.map(|k| format!(" * npm:{pkg_nv}/{k}"))
.collect::<Vec<_>>()
})
Expand Down
1 change: 0 additions & 1 deletion cli/tools/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ fn abbreviate_test_error(js_error: &JsError) -> JsError {
false
}
})
.into_iter()
.collect::<Vec<_>>();
frames.reverse();
js_error.frames = frames;
Expand Down
2 changes: 1 addition & 1 deletion runtime/ops/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ fn rss() -> usize {
}
for n in chars {
idx += 1;
if ('0'..='9').contains(&n) {
if n.is_ascii_digit() {
out *= 10;
out += n as usize - '0' as usize;
} else {
Expand Down
11 changes: 4 additions & 7 deletions runtime/permissions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ static DEBUG_LOG_ENABLED: Lazy<bool> =
Lazy::new(|| log::log_enabled!(log::Level::Debug));

/// 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 {
Granted = 0,
#[default]
Prompt = 1,
Denied = 2,
}
Expand Down Expand Up @@ -140,12 +143,6 @@ impl fmt::Display for PermissionState {
}
}

impl Default for PermissionState {
fn default() -> Self {
PermissionState::Prompt
}
}

#[derive(Clone, Debug, Eq, PartialEq)]
pub struct UnitPermission {
pub name: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.67.0"
channel = "1.68.0"
components = ["rustfmt", "clippy"]
7 changes: 2 additions & 5 deletions test_util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,13 @@ async fn run_ws_close_server(addr: &SocketAddr) {
}
}

#[derive(Default)]
enum SupportedHttpVersions {
#[default]
All,
Http1Only,
Http2Only,
}
impl Default for SupportedHttpVersions {
fn default() -> SupportedHttpVersions {
SupportedHttpVersions::All
}
}

async fn get_tls_config(
cert: &str,
Expand Down

0 comments on commit bb07e23

Please sign in to comment.