about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>2024-02-10 00:56:07 +0900
committerTetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>2024-02-10 01:00:40 +0900
commit06f3995ca9c6e205bbcbe68a7d5f1e99101a735a (patch)
tree6d5138c40e1325d795ea96f032a25460d5cce4d4
parent283b140321757fee60a87ef96724d8c5cb66bdff (diff)
downloadrust-06f3995ca9c6e205bbcbe68a7d5f1e99101a735a.tar.gz
rust-06f3995ca9c6e205bbcbe68a7d5f1e99101a735a.zip
xtask: Fix warnings about clippy `str_to_string` rule
-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 5a03c71b28a..7e54d19fe4d 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 092ab8c593c..99bb12896f1 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 e8c00c72e07..dadee204d1a 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 c05874a0cca..9bd3a661c24 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 817863336dd..086a4d463ea 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()) }
 }