summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
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);