Skip to content

Commit 312c961

Browse files
committed
Fix clippy warnings
1 parent 3e99347 commit 312c961

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

src/cmd/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ impl<'a, B: Runnable> Runnable for &'a B {
189189
///
190190
/// [std]: https://doc.rust-lang.org/std/process/struct.Command.html
191191
#[must_use = "call `.run()` to run the command"]
192+
#[allow(clippy::type_complexity)]
192193
pub struct Command<'w, 'pl> {
193194
workspace: Option<&'w Workspace>,
194195
sandbox: Option<SandboxBuilder>,
@@ -383,7 +384,7 @@ impl<'w, 'pl> Command<'w, 'pl> {
383384
};
384385

385386
builder = builder
386-
.mount(&source_dir, &*container_dirs::WORK_DIR, MountKind::ReadOnly)
387+
.mount(&source_dir, &container_dirs::WORK_DIR, MountKind::ReadOnly)
387388
.env("SOURCE_DIR", container_dirs::WORK_DIR.to_str().unwrap())
388389
.workdir(container_dirs::WORK_DIR.to_str().unwrap())
389390
.cmd(cmd);
@@ -402,12 +403,12 @@ impl<'w, 'pl> Command<'w, 'pl> {
402403
builder = builder
403404
.mount(
404405
&workspace.cargo_home(),
405-
&*container_dirs::CARGO_HOME,
406+
&container_dirs::CARGO_HOME,
406407
MountKind::ReadOnly,
407408
)
408409
.mount(
409410
&workspace.rustup_home(),
410-
&*container_dirs::RUSTUP_HOME,
411+
&container_dirs::RUSTUP_HOME,
411412
MountKind::ReadOnly,
412413
)
413414
.env("CARGO_HOME", container_dirs::CARGO_HOME.to_str().unwrap())
@@ -549,6 +550,7 @@ impl OutputKind {
549550
}
550551
}
551552

553+
#[allow(clippy::type_complexity)]
552554
async fn log_command(
553555
mut cmd: AsyncCommand,
554556
mut process_lines: Option<&mut dyn FnMut(&str, &mut ProcessLinesActions)>,

src/cmd/sandbox.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl SandboxBuilder {
281281
}
282282

283283
let out = Command::new(workspace, "docker")
284-
.args(&*args)
284+
.args(&args)
285285
.run_capture()?;
286286
Ok(Container {
287287
id: out.stdout_lines()[0].clone(),
@@ -290,6 +290,7 @@ impl SandboxBuilder {
290290
}
291291

292292
#[allow(clippy::too_many_arguments)]
293+
#[allow(clippy::type_complexity)]
293294
pub(super) fn run(
294295
self,
295296
workspace: &Workspace,
@@ -365,6 +366,7 @@ impl Container<'_> {
365366
Ok(data.pop().unwrap())
366367
}
367368

369+
#[allow(clippy::type_complexity)]
368370
fn run(
369371
&self,
370372
timeout: Option<Duration>,

tests/buildtest/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl Runner {
2525
);
2626
Ok(Runner {
2727
crate_name: if std::env::var("RUSTWIDE_TEST_INSIDE_DOCKER").is_ok() {
28-
format!("{}-inside-docker", crate_name.to_string())
28+
format!("{}-inside-docker", crate_name)
2929
} else {
3030
crate_name.to_string()
3131
},

tests/integration/purge_caches.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,14 @@ fn should_compare(base: &Path, path: &Path) -> bool {
5959
};
6060

6161
let components = components.iter().map(|c| c.as_str()).collect::<Vec<_>>();
62-
match components.as_slice() {
62+
!matches!(
63+
components.as_slice(),
6364
// The indexes could be updated during the build. The index is not considered a cache
6465
// though, so it's fine to ignore it during the comparison.
65-
["cargo-home", "registry", "index", _, ".git", ..] => false,
66-
["cargo-home", "registry", "index", _, ".cargo-index-lock"] => false,
67-
["cargo-home", "registry", "index", _, ".last-updated"] => false,
68-
69-
_ => true,
70-
}
66+
["cargo-home", "registry", "index", _, ".git", ..]
67+
| ["cargo-home", "registry", "index", _, ".cargo-index-lock"]
68+
| ["cargo-home", "registry", "index", _, ".last-updated"]
69+
)
7170
}
7271

7372
#[derive(Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)