Skip to content

Commit 06f3995

Browse files
xtask: Fix warnings about clippy str_to_string rule
1 parent 283b140 commit 06f3995

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

xtask/src/dist.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl flags::Dist {
3434
format!("{VERSION_NIGHTLY}.{patch_version}")
3535
};
3636
dist_server(sh, &format!("{version}-standalone"), &target)?;
37-
let release_tag = if stable { date_iso(sh)? } else { "nightly".to_string() };
37+
let release_tag = if stable { date_iso(sh)? } else { "nightly".to_owned() };
3838
dist_client(sh, &version, &release_tag, &target)?;
3939
} else {
4040
dist_server(sh, "0.0.0-standalone", &target)?;
@@ -155,11 +155,11 @@ impl Target {
155155
Ok(target) => target,
156156
_ => {
157157
if cfg!(target_os = "linux") {
158-
"x86_64-unknown-linux-gnu".to_string()
158+
"x86_64-unknown-linux-gnu".to_owned()
159159
} else if cfg!(target_os = "windows") {
160-
"x86_64-pc-windows-msvc".to_string()
160+
"x86_64-pc-windows-msvc".to_owned()
161161
} else if cfg!(target_os = "macos") {
162-
"x86_64-apple-darwin".to_string()
162+
"x86_64-apple-darwin".to_owned()
163163
} else {
164164
panic!("Unsupported OS, maybe try setting RA_TARGET")
165165
}

xtask/src/flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl FromStr for MeasurementType {
129129
"webrender-2022" => Ok(Self::AnalyzeWebRender),
130130
"diesel-1.4.8" => Ok(Self::AnalyzeDiesel),
131131
"hyper-0.14.18" => Ok(Self::AnalyzeHyper),
132-
_ => Err("Invalid option".to_string()),
132+
_ => Err("Invalid option".to_owned()),
133133
}
134134
}
135135
}

xtask/src/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn fix_path_for_mac(sh: &Shell) -> anyhow::Result<()> {
5050

5151
[ROOT_DIR, &home_dir]
5252
.into_iter()
53-
.map(|dir| dir.to_string() + COMMON_APP_PATH)
53+
.map(|dir| dir.to_owned() + COMMON_APP_PATH)
5454
.map(PathBuf::from)
5555
.filter(|path| path.exists())
5656
.collect()

xtask/src/metrics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ impl Host {
194194
bail!("can only collect metrics on Linux ");
195195
}
196196

197-
let os = read_field(sh, "/etc/os-release", "PRETTY_NAME=")?.trim_matches('"').to_string();
197+
let os = read_field(sh, "/etc/os-release", "PRETTY_NAME=")?.trim_matches('"').to_owned();
198198

199199
let cpu = read_field(sh, "/proc/cpuinfo", "model name")?
200200
.trim_start_matches(':')
201201
.trim()
202-
.to_string();
202+
.to_owned();
203203

204204
let mem = read_field(sh, "/proc/meminfo", "MemTotal:")?;
205205

@@ -210,7 +210,7 @@ impl Host {
210210

211211
text.lines()
212212
.find_map(|it| it.strip_prefix(field))
213-
.map(|it| it.trim().to_string())
213+
.map(|it| it.trim().to_owned())
214214
.ok_or_else(|| format_err!("can't parse {}", path))
215215
}
216216
}

xtask/src/release/changelog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,5 @@ fn parse_title_line(s: &str) -> PrInfo {
183183
return PrInfo { message, kind };
184184
}
185185
}
186-
PrInfo { kind: PrKind::Other, message: Some(s.to_string()) }
186+
PrInfo { kind: PrKind::Other, message: Some(s.to_owned()) }
187187
}

0 commit comments

Comments
 (0)