summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author林炳权 <695601626@qq.com>2024-10-16 00:10:07 +0800
committerGitHub <noreply@github.com>2024-10-15 21:40:07 +0530
commit533a9b108677f1560fe55882771a0be2bb0b0fd2 (patch)
tree39f8d1e734f40a4cdafb0e6b582ceeea26d491ea
parente4b52f5a7684cfb6754f2531e51f833a64d97d7b (diff)
chore: upgrade to rust 1.81.0 (#26261)
-rwxr-xr-x.github/workflows/ci.generate.ts2
-rw-r--r--.github/workflows/ci.yml8
-rw-r--r--cli/lsp/tsc.rs2
-rw-r--r--cli/npm/common.rs2
-rw-r--r--cli/util/fs.rs10
-rw-r--r--runtime/permissions/prompter.rs2
-rw-r--r--rust-toolchain.toml2
-rw-r--r--tests/integration/compile_tests.rs6
8 files changed, 17 insertions, 17 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index 9abedad9c..a487f11f9 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify";
// 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 = 18;
+const cacheVersion = 19;
const ubuntuX86Runner = "ubuntu-22.04";
const ubuntuX86XlRunner = "ubuntu-22.04-xl";
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d8a0682cb..57bbf6a5e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -361,8 +361,8 @@ jobs:
path: |-
~/.cargo/registry/index
~/.cargo/registry/cache
- key: '18-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
- restore-keys: '18-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
+ key: '19-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
+ restore-keys: '19-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
if: '!(matrix.skip)'
- name: Restore cache build output (PR)
uses: actions/cache/restore@v4
@@ -375,7 +375,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
- restore-keys: '18-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
+ restore-keys: '19-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
@@ -685,7 +685,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.sha256sum
!./target/*/*.tar.gz
- key: '18-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
+ key: '19-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
publish-canary:
name: publish canary
runs-on: ubuntu-22.04
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index c8b5c47f8..cfab39b20 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -3939,7 +3939,7 @@ pub struct OutliningSpan {
kind: OutliningSpanKind,
}
-const FOLD_END_PAIR_CHARACTERS: &[u8] = &[b'}', b']', b')', b'`'];
+const FOLD_END_PAIR_CHARACTERS: &[u8] = b"}])`";
impl OutliningSpan {
pub fn to_folding_range(
diff --git a/cli/npm/common.rs b/cli/npm/common.rs
index a3a828e74..de282310a 100644
--- a/cli/npm/common.rs
+++ b/cli/npm/common.rs
@@ -40,7 +40,7 @@ pub fn maybe_auth_header_for_npm_registry(
header::AUTHORIZATION,
header::HeaderValue::from_str(&format!(
"Basic {}",
- BASE64_STANDARD.encode(&format!(
+ BASE64_STANDARD.encode(format!(
"{}:{}",
username.unwrap(),
password.unwrap()
diff --git a/cli/util/fs.rs b/cli/util/fs.rs
index 2ad3affc8..2c34f486a 100644
--- a/cli/util/fs.rs
+++ b/cli/util/fs.rs
@@ -160,11 +160,11 @@ fn atomic_write_file(
data: &[u8],
) -> std::io::Result<()> {
fs.write_file(temp_file_path, data)?;
- fs.rename_file(temp_file_path, file_path).map_err(|err| {
- // clean up the created temp file on error
- let _ = fs.remove_file(temp_file_path);
- err
- })
+ fs.rename_file(temp_file_path, file_path)
+ .inspect_err(|_err| {
+ // clean up the created temp file on error
+ let _ = fs.remove_file(temp_file_path);
+ })
}
let temp_file_path = get_atomic_file_path(file_path);
diff --git a/runtime/permissions/prompter.rs b/runtime/permissions/prompter.rs
index e48e0af10..3d7536928 100644
--- a/runtime/permissions/prompter.rs
+++ b/runtime/permissions/prompter.rs
@@ -366,7 +366,7 @@ impl PermissionPrompter for TtyPrompter {
let mut input = String::new();
let result = stdin_lock.read_line(&mut input);
- let input = input.trim_end_matches(|c| c == '\r' || c == '\n');
+ let input = input.trim_end_matches(['\r', '\n']);
if result.is_err() || input.len() != 1 {
break PromptResponse::Deny;
};
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index e8d3cddd1..f19c7df47 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,3 +1,3 @@
[toolchain]
-channel = "1.80.1"
+channel = "1.81.0"
components = ["rustfmt", "clippy"]
diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs
index 0a5916f6f..a8ea5b038 100644
--- a/tests/integration/compile_tests.rs
+++ b/tests/integration/compile_tests.rs
@@ -241,7 +241,7 @@ fn compile_with_file_exists_error() {
"./compile/args.ts",
])
.run()
- .assert_matches_text(&format!(
+ .assert_matches_text(format!(
concat!(
"[WILDCARD]error: Could not compile to file '{}' because its parent directory ",
"is an existing file. You can use the `--output <file-path>` flag to ",
@@ -269,7 +269,7 @@ fn compile_with_directory_exists_error() {
&exe.to_string_lossy(),
"./compile/args.ts"
]).run()
- .assert_matches_text(&format!(
+ .assert_matches_text(format!(
concat!(
"[WILDCARD]error: Could not compile to file '{}' because a directory exists with ",
"the same name. You can use the `--output <file-path>` flag to ",
@@ -297,7 +297,7 @@ fn compile_with_conflict_file_exists_error() {
&exe.to_string_lossy(),
"./compile/args.ts"
]).run()
- .assert_matches_text(&format!(
+ .assert_matches_text(format!(
concat!(
"[WILDCARD]error: Could not compile to file '{}' because the file already exists ",
"and cannot be overwritten. Please delete the existing file or ",