1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 02:57:44 +00:00

fix some clippy warnings (#4229)

* fix some clippy warnings

* Fix the last two
This commit is contained in:
Sylvestre Ledru 2022-12-14 15:42:07 +01:00 committed by GitHub
parent e4bed1c087
commit c5728a61b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 79 deletions

View file

@ -7,7 +7,7 @@ use std::path::Path;
pub fn main() {
if let Ok(profile) = env::var("PROFILE") {
println!("cargo:rustc-cfg=build={:?}", profile);
println!("cargo:rustc-cfg=build={profile:?}");
}
const ENV_FEATURE_PREFIX: &str = "CARGO_FEATURE_";
@ -45,7 +45,7 @@ pub fn main() {
let mut phf_map = phf_codegen::Map::<&str>::new();
for krate in &crates {
let map_value = format!("({krate}::uumain, {krate}::uu_app)", krate = krate);
let map_value = format!("({krate}::uumain, {krate}::uu_app)");
match krate.as_ref() {
// 'test' is named uu_test to avoid collision with rust core crate 'test'.
// It can also be invoked by name '[' for the '[ expr ] syntax'.
@ -57,22 +57,14 @@ pub fn main() {
phf_map.entry(&k[OVERRIDE_PREFIX.len()..], &map_value);
}
"false" | "true" => {
phf_map.entry(
krate,
&format!("(r#{krate}::uumain, r#{krate}::uu_app)", krate = krate),
);
phf_map.entry(krate, &format!("(r#{krate}::uumain, r#{krate}::uu_app)"));
}
"hashsum" => {
phf_map.entry(
krate,
&format!("({krate}::uumain, {krate}::uu_app_custom)", krate = krate),
);
phf_map.entry(krate, &format!("({krate}::uumain, {krate}::uu_app_custom)"));
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)", krate = krate);
let map_value_bits =
format!("({krate}::uumain, {krate}::uu_app_bits)", krate = krate);
let map_value_b3sum =
format!("({krate}::uumain, {krate}::uu_app_b3sum)", krate = krate);
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
let map_value_bits = format!("({krate}::uumain, {krate}::uu_app_bits)");
let map_value_b3sum = format!("({krate}::uumain, {krate}::uu_app_b3sum)");
phf_map.entry("md5sum", &map_value);
phf_map.entry("sha1sum", &map_value);
phf_map.entry("sha224sum", &map_value);