summaryrefslogtreecommitdiff
path: root/cli
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 /cli
parente4b52f5a7684cfb6754f2531e51f833a64d97d7b (diff)
chore: upgrade to rust 1.81.0 (#26261)
Diffstat (limited to 'cli')
-rw-r--r--cli/lsp/tsc.rs2
-rw-r--r--cli/npm/common.rs2
-rw-r--r--cli/util/fs.rs10
3 files changed, 7 insertions, 7 deletions
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);