diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index f82dc3dc51..23e5227283 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import * as yaml from "https://deno.land/std@0.173.0/encoding/yaml.ts"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 44; +const cacheVersion = 45; const Runners = (() => { const ubuntuRunner = "ubuntu-22.04"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 121f1af8a7..d95710cfed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -304,8 +304,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '44-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '44-cargo-home-${{ matrix.os }}' + key: '45-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '45-cargo-home-${{ matrix.os }}' if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)' - name: Restore cache build output (PR) uses: actions/cache/restore@v3 @@ -317,7 +317,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '44-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '45-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -605,7 +605,7 @@ jobs: !./target/*/gn_out !./target/*/*.zip !./target/*/*.tar.gz - key: '44-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '45-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-22.04 diff --git a/cli/args/lockfile.rs b/cli/args/lockfile.rs index 2a874a6981..9903ba6421 100644 --- a/cli/args/lockfile.rs +++ b/cli/args/lockfile.rs @@ -122,7 +122,7 @@ pub async fn snapshot_from_lockfile( while let Some(result) = version_infos.next().await { match result { Ok(version_info) => { - let mut package = &mut packages[i]; + let package = &mut packages[i]; package.dist = version_info.dist; package.system = NpmResolutionPackageSystemInfo { cpu: version_info.cpu, diff --git a/cli/tools/coverage/range_tree.rs b/cli/tools/coverage/range_tree.rs index 8b3d36cd81..c3bba79429 100644 --- a/cli/tools/coverage/range_tree.rs +++ b/cli/tools/coverage/range_tree.rs @@ -86,7 +86,7 @@ impl<'rt> RangeTree<'rt> { }; if is_chain_end { let mut chain_iter = chain.drain(..); - let mut head: &'a mut RangeTree<'a> = chain_iter.next().unwrap(); + let head: &'a mut RangeTree<'a> = chain_iter.next().unwrap(); for tree in chain_iter { head.end = tree.end; for sub_child in tree.children.drain(..) { @@ -100,7 +100,7 @@ impl<'rt> RangeTree<'rt> { } if !chain.is_empty() { let mut chain_iter = chain.drain(..); - let mut head: &'a mut RangeTree<'a> = chain_iter.next().unwrap(); + let head: &'a mut RangeTree<'a> = chain_iter.next().unwrap(); for tree in chain_iter { head.end = tree.end; for sub_child in tree.children.drain(..) { diff --git a/cli/tools/repl/editor.rs b/cli/tools/repl/editor.rs index 759ff23d3c..a27671b217 100644 --- a/cli/tools/repl/editor.rs +++ b/cli/tools/repl/editor.rs @@ -530,8 +530,7 @@ impl ConditionalEventHandler for TabEventHandler { if ctx.line().is_empty() || ctx.line()[..ctx.pos()] .chars() - .rev() - .next() + .next_back() .filter(|c| c.is_whitespace()) .is_some() { diff --git a/ext/http/websocket_upgrade.rs b/ext/http/websocket_upgrade.rs index 70ad785267..f57f9e56ba 100644 --- a/ext/http/websocket_upgrade.rs +++ b/ext/http/websocket_upgrade.rs @@ -131,12 +131,9 @@ impl WebSocketUpgrade { HEADER_SEARCHER.get_or_init(|| TwoWaySearcher::new(b"\r\n\r\n")); let header_searcher2 = HEADER_SEARCHER2.get_or_init(|| TwoWaySearcher::new(b"\n\n")); - if let Some(..) = header_searcher.search_in(&self.buf) { - let (index, response) = parse_response(&self.buf)?; - let mut buf = std::mem::take(&mut self.buf); - self.state = Complete; - Ok(Some((response, buf.split_off(index).freeze()))) - } else if let Some(..) = header_searcher2.search_in(&self.buf) { + if header_searcher.search_in(&self.buf).is_some() + || header_searcher2.search_in(&self.buf).is_some() + { let (index, response) = parse_response(&self.buf)?; let mut buf = std::mem::take(&mut self.buf); self.state = Complete; diff --git a/ext/napi/function.rs b/ext/napi/function.rs index 49e9a35701..a999972255 100644 --- a/ext/napi/function.rs +++ b/ext/napi/function.rs @@ -37,7 +37,7 @@ extern "C" fn call_fn(info: *const v8::FunctionCallbackInfo) { }; // SAFETY: pointer from Box::into_raw. - let mut info = unsafe { &mut *info_ptr }; + let info = unsafe { &mut *info_ptr }; info.args = &args as *const _ as *const c_void; if let Some(f) = info.cb { diff --git a/ext/web/hr_timer_lock.rs b/ext/web/hr_timer_lock.rs index f1f588d6c8..cd141a638e 100644 --- a/ext/web/hr_timer_lock.rs +++ b/ext/web/hr_timer_lock.rs @@ -63,5 +63,5 @@ pub(crate) fn hr_timer_lock() -> windows::HrTimerLock { /// No-op on other platforms. #[cfg(not(target_os = "windows"))] pub(crate) fn hr_timer_lock() -> (std::marker::PhantomData<()>,) { - (std::marker::PhantomData::default(),) + Default::default() } diff --git a/runtime/ops/os/sys_info.rs b/runtime/ops/os/sys_info.rs index d51ac1fb40..e9cbbafb6e 100644 --- a/runtime/ops/os/sys_info.rs +++ b/runtime/ops/os/sys_info.rs @@ -210,7 +210,7 @@ pub fn mem_info() -> Option { mem_info.buffers = info.bufferram * mem_unit; } } - #[cfg(any(target_vendor = "apple"))] + #[cfg(target_vendor = "apple")] { let mut mib: [i32; 2] = [0, 0]; mib[0] = libc::CTL_HW; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0538cafabc..9058c7d87d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.70" +channel = "1.71.0" components = ["rustfmt", "clippy"] diff --git a/test_ffi/tests/thread_safe_test.js b/test_ffi/tests/thread_safe_test.js index 41ab803be8..fd5e1840c4 100644 --- a/test_ffi/tests/thread_safe_test.js +++ b/test_ffi/tests/thread_safe_test.js @@ -84,7 +84,8 @@ const cleanupCallback = new Deno.UnsafeCallback( { parameters: [], result: "void" }, () => { console.log("Callback being called"); - queueMicrotask(() => cleanup()); + // Defer the cleanup to give the spawned thread all the time it needs to properly shut down + setTimeout(() => cleanup(), 100); }, );