Skip to content

Commit 5ede8ba

Browse files
committed
apease clippy
1 parent 9c494f3 commit 5ede8ba

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() -> Result<(), Box<dyn Error>> {
88
let target = std::env::var("TARGET")?;
99

1010
let output = std::env::var("OUT_DIR")?;
11-
::std::fs::write(format!("{}/target", output), target.as_bytes())?;
11+
::std::fs::write(format!("{output}/target"), target.as_bytes())?;
1212

1313
println!("cargo:rerun-if-env-changed=DOCS_RS");
1414
if std::env::var_os("DOCS_RS").as_deref() == Some(std::ffi::OsStr::new("1")) {

src/cmd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl<'w, 'pl> Command<'w, 'pl> {
501501
cmd.env(k, v);
502502
}
503503

504-
let cmdstr = format!("{:?}", cmd);
504+
let cmdstr = format!("{cmd:?}");
505505

506506
if let Some(ref cd) = self.cd {
507507
cmd.current_dir(cd);

src/cmd/sandbox.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl SandboxBuilder {
219219
}
220220

221221
pub(super) fn user(mut self, user: u32, group: u32) -> Self {
222-
self.user = Some(format!("{}:{}", user, group));
222+
self.user = Some(format!("{user}:{group}"));
223223
self
224224
}
225225

@@ -242,7 +242,7 @@ impl SandboxBuilder {
242242

243243
for (var, value) in &self.env {
244244
args.push("-e".into());
245-
args.push(format! {"{}={}", var, value})
245+
args.push(format! {"{var}={value}"})
246246
}
247247

248248
if let Some(workdir) = self.workdir {

src/crates/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl RegistryCrate {
122122
git2::build::RepoBuilder::new()
123123
.fetch_options(fo)
124124
.clone(url, &index_path)
125-
.with_context(|| format!("unable to update_index at {}", url))?;
125+
.with_context(|| format!("unable to update_index at {url}"))?;
126126
info!("cloned registry index");
127127
}
128128
let config = std::fs::read_to_string(index_path.join("config.json"))?;

src/prepare.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ pub enum PrepareError {
390390
/// Some of the dependencies do not exist anymore.
391391
#[error("the crate depends on missing dependencies: \n\n{0}")]
392392
MissingDependencies(String),
393+
/// Some not further detaild error
393394
#[error("prepare failed without further details")]
394395
Unknown,
395396
}

src/toolchain.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,7 @@ impl Toolchain {
407407
.collect()),
408408
Err(_) if not_installed => Err(ToolchainError::NotInstalled.into()),
409409
Err(err) => Err(anyhow!(err).context(format!(
410-
"failed to read the list of installed {}s for {} with rustup",
411-
thing, name
410+
"failed to read the list of installed {thing}s for {name} with rustup"
412411
))),
413412
}
414413
}
@@ -419,7 +418,7 @@ impl Toolchain {
419418
Command::new(workspace, &RUSTUP)
420419
.args(&["toolchain", "uninstall", &name])
421420
.run()
422-
.with_context(|| format!("unable to uninstall toolchain {} via rustup", name))?;
421+
.with_context(|| format!("unable to uninstall toolchain {name} via rustup"))?;
423422
Ok(())
424423
}
425424

src/tools/rustup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Tool for Rustup {
4949
.error_for_status()?;
5050

5151
let tempdir = tempdir()?;
52-
let installer = &tempdir.path().join(format!("rustup-init{}", EXE_SUFFIX));
52+
let installer = &tempdir.path().join(format!("rustup-init{EXE_SUFFIX}"));
5353
{
5454
let mut file = File::create(installer)?;
5555
io::copy(&mut resp, &mut file)?;
@@ -81,7 +81,7 @@ impl Tool for Rustup {
8181
Command::new(workspace, &RUSTUP)
8282
.args(&["update", MAIN_TOOLCHAIN_NAME])
8383
.run()
84-
.with_context(|| format!("failed to update main toolchain {}", MAIN_TOOLCHAIN_NAME))?;
84+
.with_context(|| format!("failed to update main toolchain {MAIN_TOOLCHAIN_NAME}"))?;
8585
Ok(())
8686
}
8787
}

0 commit comments

Comments
 (0)