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
This commit is contained in:
Matthias Krüger 2024-04-25 18:57:56 +02:00 committed by GitHub
commit b28721fd96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View file

@ -1,7 +1,7 @@
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP");
if !std::env::var("RUSTC_BOOTSTRAP").is_ok() {
if std::env::var("RUSTC_BOOTSTRAP").is_err() {
eprintln!(
"error: you are attempting to build the compiler without going through bootstrap"
);