diff options
| author | Michael Goulet <michael@errs.io> | 2023-10-13 08:58:33 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-10-13 08:59:36 +0000 |
| commit | b2d2184edea578109a48ec3d8decbee5948e8f35 (patch) | |
| tree | 84a351b1b08b838e0adcb1062ec04c344524e6c2 /compiler/rustc_session | |
| parent | 2763ca50da1192aa28295ef4dbe5d06443e1b90a (diff) | |
| download | rust-b2d2184edea578109a48ec3d8decbee5948e8f35.tar.gz rust-b2d2184edea578109a48ec3d8decbee5948e8f35.zip | |
Format all the let chains in compiler
Diffstat (limited to 'compiler/rustc_session')
| -rw-r--r-- | compiler/rustc_session/src/output.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_session/src/utils.rs | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_session/src/output.rs b/compiler/rustc_session/src/output.rs index 7a57b0621cd..9cd96895a61 100644 --- a/compiler/rustc_session/src/output.rs +++ b/compiler/rustc_session/src/output.rs @@ -186,10 +186,14 @@ pub fn invalid_output_for_target(sess: &Session, crate_type: CrateType) -> bool return true; } } - if let CrateType::ProcMacro | CrateType::Dylib = crate_type && sess.target.only_cdylib { + if let CrateType::ProcMacro | CrateType::Dylib = crate_type + && sess.target.only_cdylib + { return true; } - if let CrateType::Executable = crate_type && !sess.target.executables { + if let CrateType::Executable = crate_type + && !sess.target.executables + { return true; } diff --git a/compiler/rustc_session/src/utils.rs b/compiler/rustc_session/src/utils.rs index aea7c6c2842..3ed044ad769 100644 --- a/compiler/rustc_session/src/utils.rs +++ b/compiler/rustc_session/src/utils.rs @@ -161,7 +161,9 @@ pub fn extra_compiler_flags() -> Option<(Vec<String>, bool)> { pub(crate) fn is_ascii_ident(string: &str) -> bool { let mut chars = string.chars(); - if let Some(start) = chars.next() && (start.is_ascii_alphabetic() || start == '_') { + if let Some(start) = chars.next() + && (start.is_ascii_alphabetic() || start == '_') + { chars.all(|char| char.is_ascii_alphanumeric() || char == '_') } else { false |
