diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 2508862833ac8..c4b9f0a86d8fa 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -30,7 +30,7 @@ use tower_lsp::lsp_types::Range; /// fixes we treat them the same. static FIX_ALL_ERROR_CODES: Lazy> = Lazy::new(|| { - (&[("2339", "2339"), ("2345", "2339")]) + ([("2339", "2339"), ("2345", "2339")]) .iter() .cloned() .collect() @@ -40,7 +40,7 @@ static FIX_ALL_ERROR_CODES: Lazy> = /// multiple fixes available. static PREFERRED_FIXES: Lazy> = Lazy::new(|| { - (&[ + ([ ("annotateWithTypeFromJSDoc", (1, false)), ("constructorForDerivedNeedSuperCall", (1, false)), ("extendsInterfaceBecomesImplements", (1, false)), @@ -54,9 +54,9 @@ static PREFERRED_FIXES: Lazy> = ("addMissingAwait", (1, false)), ("fixImport", (0, true)), ]) - .iter() - .cloned() - .collect() + .iter() + .cloned() + .collect() }); static IMPORT_SPECIFIER_RE: Lazy = diff --git a/cli/progress_bar.rs b/cli/progress_bar.rs index f52d137c2bbb7..36cdff7c66c94 100644 --- a/cli/progress_bar.rs +++ b/cli/progress_bar.rs @@ -121,12 +121,9 @@ impl ProgressBar { pub fn clear(&self) { let mut inner = self.0.lock(); - match inner.pb.as_ref() { - Some(pb) => { - pb.finish_and_clear(); - inner.pb = None; - } - None => {} - }; + if let Some(pb) = inner.pb.as_ref() { + pb.finish_and_clear(); + inner.pb = None; + } } } diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index f2af48f26b0fb..832577aa2e142 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -108,7 +108,7 @@ pub async fn format( files .iter() .any(|path| paths.contains(path)) - .then(|| files) + .then_some(files) .unwrap_or_else(|| [].to_vec()) } else { files diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs index 0bee44d4c0051..da5df3a813e69 100644 --- a/cli/tools/lint.rs +++ b/cli/tools/lint.rs @@ -128,7 +128,7 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { files .iter() .any(|path| paths.contains(path)) - .then(|| files) + .then_some(files) .unwrap_or_else(|| [].to_vec()) } else { files diff --git a/cli/tsc.rs b/cli/tsc.rs index 54989a4ed8fa7..1951c5a101b01 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -84,7 +84,7 @@ macro_rules! inc { /// Contains static assets that are not preloaded in the compiler snapshot. pub static STATIC_ASSETS: Lazy> = Lazy::new(|| { - (&[ + ([ ( "lib.dom.asynciterable.d.ts", inc!("lib.dom.asynciterable.d.ts"), @@ -112,9 +112,9 @@ pub static STATIC_ASSETS: Lazy> = inc!("lib.webworker.iterable.d.ts"), ), ]) - .iter() - .cloned() - .collect() + .iter() + .cloned() + .collect() }); /// A structure representing stats from a type check operation for a graph. diff --git a/cli/worker.rs b/cli/worker.rs index f46c2efce7ed5..cc497630ed90e 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -141,9 +141,7 @@ impl CliMainWorker { }; self.pending_unload = false; - if let Err(err) = result { - return Err(err); - } + result?; self .inner diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4a6c2662000c0..cc8f987ef3448 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.63.0" +channel = "1.64.0" components = ["rustfmt", "clippy"]