Skip to content

Commit a051909

Browse files
committed
refactor: fix clippy warnings
1 parent 693fd9f commit a051909

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/dist/component/components.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl Components {
8989
}
9090
pub fn find(&self, name: &str) -> Result<Option<Component>> {
9191
let result = self.list()?;
92-
Ok(result.into_iter().find(|c| (c.name() == name)))
92+
Ok(result.into_iter().find(|c| c.name() == name))
9393
}
9494
pub(crate) fn prefix(&self) -> InstallPrefix {
9595
self.prefix.clone()

src/test/clitools.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl Config {
291291
/// specified by `args` under the default environment.
292292
#[must_use]
293293
pub async fn expect<S: AsRef<OsStr> + Clone + Debug>(&self, args: impl AsRef<[S]>) -> Assert {
294-
self.expect_with_env(args, &[]).await
294+
self.expect_with_env(args, []).await
295295
}
296296

297297
/// Returns an [`Assert`] object to check the output of running the command

tests/suite/cli_rustup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ async fn show_toolchain_env() {
13271327
.await
13281328
.is_ok();
13291329
cx.config
1330-
.expect_with_env(["rustup", "show"], &[("RUSTUP_TOOLCHAIN", "nightly")])
1330+
.expect_with_env(["rustup", "show"], [("RUSTUP_TOOLCHAIN", "nightly")])
13311331
.await
13321332
.extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())])
13331333
.is_ok()
@@ -1353,7 +1353,7 @@ installed targets:
13531353
async fn show_toolchain_env_not_installed() {
13541354
let cx = CliTestContext::new(Scenario::SimpleV2).await;
13551355
cx.config
1356-
.expect_with_env(["rustup", "show"], &[("RUSTUP_TOOLCHAIN", "nightly")])
1356+
.expect_with_env(["rustup", "show"], [("RUSTUP_TOOLCHAIN", "nightly")])
13571357
.await
13581358
.extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())])
13591359
.is_ok()
@@ -3027,7 +3027,7 @@ error: no active toolchain
30273027
"show",
30283028
"active-toolchain",
30293029
],
3030-
&[("RUSTUP_TOOLCHAIN", &**env_tc)],
3030+
[("RUSTUP_TOOLCHAIN", &**env_tc)],
30313031
)
30323032
.await
30333033
.extend_redactions([("[COMMAND_TC]", command_tc)])

tests/suite/cli_v2.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ async fn plus_override_toolchain_err_handling() {
543543
cx.config
544544
.expect_with_env(
545545
["rustc", "+beta", "--version"],
546-
&[("RUSTUP_AUTO_INSTALL", "0")],
546+
[("RUSTUP_AUTO_INSTALL", "0")],
547547
)
548548
.await
549549
.with_stderr(snapbox::str![[r#"
@@ -1191,7 +1191,7 @@ async fn list_targets_no_toolchain() {
11911191
cx.config
11921192
.expect_with_env(
11931193
["rustup", "target", "list", "--toolchain=nightly"],
1194-
&[("RUSTUP_AUTO_INSTALL", "0")],
1194+
[("RUSTUP_AUTO_INSTALL", "0")],
11951195
)
11961196
.await
11971197
.with_stderr(snapbox::str![[r#"
@@ -1221,7 +1221,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' is not installed
12211221
cx.config
12221222
.expect_with_env(
12231223
["rustup", "target", "list", "--toolchain=nightly"],
1224-
&[("RUSTUP_AUTO_INSTALL", "0")],
1224+
[("RUSTUP_AUTO_INSTALL", "0")],
12251225
)
12261226
.await
12271227
.with_stderr(snapbox::str![[r#"
@@ -1234,7 +1234,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' is not installed
12341234
cx.config
12351235
.expect_with_env(
12361236
["rustup", "target", "list", "--toolchain=nightly"],
1237-
&[("RUSTUP_AUTO_INSTALL", "1")],
1237+
[("RUSTUP_AUTO_INSTALL", "1")],
12381238
)
12391239
.await
12401240
.is_ok();
@@ -1502,7 +1502,7 @@ async fn add_target_no_toolchain() {
15021502
CROSS_ARCH1,
15031503
"--toolchain=nightly",
15041504
],
1505-
&[("RUSTUP_AUTO_INSTALL", "0")],
1505+
[("RUSTUP_AUTO_INSTALL", "0")],
15061506
)
15071507
.await
15081508
.with_stderr(snapbox::str![[r#"
@@ -1725,7 +1725,7 @@ async fn remove_target_no_toolchain() {
17251725
CROSS_ARCH1,
17261726
"--toolchain=nightly",
17271727
],
1728-
&[("RUSTUP_AUTO_INSTALL", "0")],
1728+
[("RUSTUP_AUTO_INSTALL", "0")],
17291729
)
17301730
.await
17311731
.with_stderr(snapbox::str![[r#"

0 commit comments

Comments
 (0)