Skip to content

Commit 87fa15d

Browse files
authored
Merge pull request #3379 from hi-rustin/rustin-patch-clippy
2 parents 849adb7 + 0c76ab3 commit 87fa15d

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

src/cli/download_tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl DownloadTracker {
6161
term: process().stdout().terminal(),
6262
displayed_charcount: None,
6363
units: vec![Unit::B],
64-
display_progress: display_progress,
64+
display_progress,
6565
}))
6666
}
6767

src/cli/self_update/shell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl UnixShell for Zsh {
175175
fn does_exist(&self) -> bool {
176176
// zsh has to either be the shell or be callable for zsh setup.
177177
matches!(process().var("SHELL"), Ok(sh) if sh.contains("zsh"))
178-
|| matches!(utils::find_cmd(&["zsh"]), Some(_))
178+
|| utils::find_cmd(&["zsh"]).is_some()
179179
}
180180

181181
fn rcfiles(&self) -> Vec<PathBuf> {
@@ -195,7 +195,7 @@ impl UnixShell for Zsh {
195195
self.rcfiles()
196196
.into_iter()
197197
.filter(|env| env.is_file())
198-
.chain(self.rcfiles().into_iter())
198+
.chain(self.rcfiles())
199199
.take(1)
200200
.collect()
201201
}

src/env_var.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mod tests {
5252
let mut vars = HashMap::new();
5353
vars.env(
5454
"PATH",
55-
env::join_paths(vec!["/home/a/.cargo/bin", "/home/b/.cargo/bin"].iter()).unwrap(),
55+
env::join_paths(["/home/a/.cargo/bin", "/home/b/.cargo/bin"].iter()).unwrap(),
5656
);
5757
let tp = currentprocess::TestProcess {
5858
vars,
@@ -84,7 +84,7 @@ mod tests {
8484
OsStr::new("PATH"),
8585
Some(
8686
env::join_paths(
87-
vec![
87+
[
8888
"/home/z/.cargo/bin",
8989
"/home/a/.cargo/bin",
9090
"/home/b/.cargo/bin"

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
clippy::type_complexity,
55
clippy::upper_case_acronyms, // see https://github.com/rust-lang/rust-clippy/issues/6974
66
clippy::vec_init_then_push, // uses two different styles of initialization
7-
clippy::box_default, // its ugly and outside of inner loops irrelevant
7+
clippy::box_default, // its ugly and outside of inner loops irrelevant
88
clippy::result_large_err, // 288 bytes is our 'large' variant today, which is unlikely to be a performance problem
9+
clippy::arc_with_non_send_sync, // will get resolved as we move further into async
910
)]
1011
#![recursion_limit = "1024"]
1112

src/test/mock/clitools.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,14 +1194,11 @@ fn build_mock_channel(
11941194
// Convert the mock installers to mock package definitions for the
11951195
// mock dist server
11961196
let mut all = MockChannelContent::default();
1197-
all.std.extend(
1198-
vec![
1199-
(std, host_triple.clone()),
1200-
(cross_std1, CROSS_ARCH1.to_string()),
1201-
(cross_std2, CROSS_ARCH2.to_string()),
1202-
]
1203-
.into_iter(),
1204-
);
1197+
all.std.extend(vec![
1198+
(std, host_triple.clone()),
1199+
(cross_std1, CROSS_ARCH1.to_string()),
1200+
(cross_std2, CROSS_ARCH2.to_string()),
1201+
]);
12051202
all.rustc.push((rustc, host_triple.clone()));
12061203
all.cargo.push((cargo, host_triple.clone()));
12071204

src/test/mock/dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl MockDistServer {
131131
let mut hashes = HashMap::new();
132132
for package in &channel.packages {
133133
let new_hashes = self.build_package(channel, package, enable_xz, enable_zst);
134-
hashes.extend(new_hashes.into_iter());
134+
hashes.extend(new_hashes);
135135
}
136136
for v in vs {
137137
match *v {

tests/suite/cli_rustup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ fn non_utf8_arg() {
21782178
config.expect_ok(&["rustup", "default", "nightly"]);
21792179
let out = config.run(
21802180
"rustc",
2181-
&[
2181+
[
21822182
OsStr::new("--echo-args"),
21832183
OsStr::new("echoed non-utf8 arg:"),
21842184
OsStr::from_bytes(b"\xc3\x28"),
@@ -2224,7 +2224,7 @@ fn non_utf8_toolchain() {
22242224
config.expect_ok(&["rustup", "default", "nightly"]);
22252225
let out = config.run(
22262226
"rustc",
2227-
&[OsStr::from_bytes(b"+\xc3\x28")],
2227+
[OsStr::from_bytes(b"+\xc3\x28")],
22282228
&[("RUST_BACKTRACE", "1")],
22292229
);
22302230
assert!(out.stderr.contains("toolchain '�(' is not installable"));

0 commit comments

Comments
 (0)