Unnamed repository; edit this file 'description' to name the repository.
xtask: Fix warnings about clippy `str_to_string` rule
Tetsuharu Ohzeki 2024-02-09
parent 283b140 · commit 06f3995
-rw-r--r--xtask/src/dist.rs8
-rw-r--r--xtask/src/flags.rs2
-rw-r--r--xtask/src/install.rs2
-rw-r--r--xtask/src/metrics.rs6
-rw-r--r--xtask/src/release/changelog.rs2
5 files changed, 10 insertions, 10 deletions
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs
index 5a03c71b28..7e54d19fe4 100644
--- a/xtask/src/dist.rs
+++ b/xtask/src/dist.rs
@@ -34,7 +34,7 @@ impl flags::Dist {
format!("{VERSION_NIGHTLY}.{patch_version}")
};
dist_server(sh, &format!("{version}-standalone"), &target)?;
- let release_tag = if stable { date_iso(sh)? } else { "nightly".to_string() };
+ let release_tag = if stable { date_iso(sh)? } else { "nightly".to_owned() };
dist_client(sh, &version, &release_tag, &target)?;
} else {
dist_server(sh, "0.0.0-standalone", &target)?;
@@ -155,11 +155,11 @@ impl Target {
Ok(target) => target,
_ => {
if cfg!(target_os = "linux") {
- "x86_64-unknown-linux-gnu".to_string()
+ "x86_64-unknown-linux-gnu".to_owned()
} else if cfg!(target_os = "windows") {
- "x86_64-pc-windows-msvc".to_string()
+ "x86_64-pc-windows-msvc".to_owned()
} else if cfg!(target_os = "macos") {
- "x86_64-apple-darwin".to_string()
+ "x86_64-apple-darwin".to_owned()
} else {
panic!("Unsupported OS, maybe try setting RA_TARGET")
}
diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs
index 092ab8c593..99bb12896f 100644
--- a/xtask/src/flags.rs
+++ b/xtask/src/flags.rs
@@ -129,7 +129,7 @@ impl FromStr for MeasurementType {
"webrender-2022" => Ok(Self::AnalyzeWebRender),
"diesel-1.4.8" => Ok(Self::AnalyzeDiesel),
"hyper-0.14.18" => Ok(Self::AnalyzeHyper),
- _ => Err("Invalid option".to_string()),
+ _ => Err("Invalid option".to_owned()),
}
}
}
diff --git a/xtask/src/install.rs b/xtask/src/install.rs
index e8c00c72e0..dadee204d1 100644
--- a/xtask/src/install.rs
+++ b/xtask/src/install.rs
@@ -50,7 +50,7 @@ fn fix_path_for_mac(sh: &Shell) -> anyhow::Result<()> {
[ROOT_DIR, &home_dir]
.into_iter()
- .map(|dir| dir.to_string() + COMMON_APP_PATH)
+ .map(|dir| dir.to_owned() + COMMON_APP_PATH)
.map(PathBuf::from)
.filter(|path| path.exists())
.collect()
diff --git a/xtask/src/metrics.rs b/xtask/src/metrics.rs
index c05874a0cc..9bd3a661c2 100644
--- a/xtask/src/metrics.rs
+++ b/xtask/src/metrics.rs
@@ -194,12 +194,12 @@ impl Host {
bail!("can only collect metrics on Linux ");
}
- let os = read_field(sh, "/etc/os-release", "PRETTY_NAME=")?.trim_matches('"').to_string();
+ let os = read_field(sh, "/etc/os-release", "PRETTY_NAME=")?.trim_matches('"').to_owned();
let cpu = read_field(sh, "/proc/cpuinfo", "model name")?
.trim_start_matches(':')
.trim()
- .to_string();
+ .to_owned();
let mem = read_field(sh, "/proc/meminfo", "MemTotal:")?;
@@ -210,7 +210,7 @@ impl Host {
text.lines()
.find_map(|it| it.strip_prefix(field))
- .map(|it| it.trim().to_string())
+ .map(|it| it.trim().to_owned())
.ok_or_else(|| format_err!("can't parse {}", path))
}
}
diff --git a/xtask/src/release/changelog.rs b/xtask/src/release/changelog.rs
index 817863336d..086a4d463e 100644
--- a/xtask/src/release/changelog.rs
+++ b/xtask/src/release/changelog.rs
@@ -183,5 +183,5 @@ fn parse_title_line(s: &str) -> PrInfo {
return PrInfo { message, kind };
}
}
- PrInfo { kind: PrKind::Other, message: Some(s.to_string()) }
+ PrInfo { kind: PrKind::Other, message: Some(s.to_owned()) }
}