Skip to content

Commit

Permalink
Resolve uninlined_format_args pedantic clippy lint in build script
Browse files Browse the repository at this point in the history
    warning: variables can be used directly in the `format!` string
       --> build.rs:140:9
        |
    140 | /         eprintln!(
    141 | |             "Environment variable ${} is not set during execution of build script",
    142 | |             key,
    143 | |         );
        | |_________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
        = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
  • Loading branch information
dtolnay committed Oct 31, 2024
1 parent 0e2bef9 commit 8fb92ff
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {

fn cargo_env_var(key: &str) -> OsString {
env::var_os(key).unwrap_or_else(|| {
eprintln!(
"Environment variable ${} is not set during execution of build script",
key,
);
eprintln!("Environment variable ${key} is not set during execution of build script");
process::exit(1);
})
}

0 comments on commit 8fb92ff

Please sign in to comment.