diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-25 18:57:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-25 18:57:56 +0200 |
| commit | b28721fd96d3b88ef4bdfb8bce6e54399e01fb91 (patch) | |
| tree | 85ec930d9b2c53439a7bb2ca38a7a0a29c611ee2 /compiler/rustc_llvm | |
| parent | 6a9758d4f38d4763bd437c48fa7e5246cecf8d04 (diff) | |
| parent | 3c5e88c7d19fee810ce5bdaaae8c9da8caabd6eb (diff) | |
| download | rust-b28721fd96d3b88ef4bdfb8bce6e54399e01fb91.tar.gz rust-b28721fd96d3b88ef4bdfb8bce6e54399e01fb91.zip | |
Rollup merge of #124287 - 41Leahcim:master, r=fmease
Improved code with clippy
I haven't used the bootstrapped compiler, but I think I have made some improvements using clippy. I have already made the following changes to the compiler:
Replaced `self.first().is_digit(10)` with `self.first().is_ascii_digit()` on lines 633, 664, and 680 of compiler/rust_lexer/src/lib.rs.
Removed unnecessary cast on line 262 of compiler/rustc_lexer/src/unescape.rs
Replaced ok_or_else with ok_or on line 303 of compiler/rustc_lexer/src/unescape.rs
Replaced `!std::env::var("RUSTC_BOOTSTRAP").is_ok()` with `std::env::var("RUSTC_BOOTSTRAP").is_err()` on line 4 of compiler/rustc_macros/build.rs
Removed needless borrow for generic argument `env`on line 53 of compiler/rust_llvm/build.rs
Diffstat (limited to 'compiler/rustc_llvm')
| -rw-r--r-- | compiler/rustc_llvm/build.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index 66ca94d1d9c..024f6f89a4b 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -50,7 +50,7 @@ fn detect_llvm_link() -> (&'static str, &'static str) { fn restore_library_path() { let key = tracked_env_var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR"); if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") { - env::set_var(&key, &env); + env::set_var(&key, env); } else { env::remove_var(&key); } |
