mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
style: Use inlined format args
This commit is contained in:
parent
e5987ea9b6
commit
0b611990f4
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -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",
|
||||||
]
|
]
|
||||||
|
@ -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
|
||||||
|
@ -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}"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user