style: Use inlined format args

This commit is contained in:
Ed Page 2025-06-26 16:40:32 -05:00
parent e5987ea9b6
commit 0b611990f4
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@ -249,7 +249,7 @@ dependencies = [
[[package]] [[package]]
name = "build-rs" name = "build-rs"
version = "0.3.1" version = "0.3.2"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "build-rs" name = "build-rs"
version = "0.3.1" version = "0.3.2"
rust-version.workspace = true rust-version.workspace = true
edition.workspace = true edition.workspace = true
license.workspace = true license.workspace = true

View File

@ -13,7 +13,7 @@ use std::{fmt::Display, fmt::Write as _};
use crate::ident::{is_ascii_ident, is_ident}; use crate::ident::{is_ascii_ident, is_ident};
fn emit(directive: &str, value: impl Display) { fn emit(directive: &str, value: impl Display) {
println!("cargo::{}={}", directive, value); println!("cargo::{directive}={value}");
} }
/// The `rerun-if-changed` instruction tells Cargo to re-run the build script if the /// The `rerun-if-changed` instruction tells Cargo to re-run the build script if the
@ -97,7 +97,7 @@ pub fn rustc_link_arg_bin(bin: &str, flag: &str) {
if flag.contains([' ', '\n']) { if flag.contains([' ', '\n']) {
panic!("cannot emit rustc-link-arg-bin: invalid flag {flag:?}"); panic!("cannot emit rustc-link-arg-bin: invalid flag {flag:?}");
} }
emit("rustc-link-arg-bin", format_args!("{}={}", bin, flag)); emit("rustc-link-arg-bin", format_args!("{bin}={flag}"));
} }
/// The `rustc-link-arg-bins` instruction tells Cargo to pass the /// The `rustc-link-arg-bins` instruction tells Cargo to pass the
@ -433,5 +433,5 @@ pub fn metadata(key: &str, val: &str) {
panic!("cannot emit metadata: invalid value {val:?}"); panic!("cannot emit metadata: invalid value {val:?}");
} }
emit("metadata", format_args!("{}={}", key, val)); emit("metadata", format_args!("{key}={val}"));
} }