Skip to content

Commit

Permalink
Merge pull request #3379 from hi-rustin/rustin-patch-clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 authored Jul 18, 2023
2 parents 849adb7 + 0c76ab3 commit 87fa15d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/cli/download_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl DownloadTracker {
term: process().stdout().terminal(),
displayed_charcount: None,
units: vec![Unit::B],
display_progress: display_progress,
display_progress,
}))
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/self_update/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl UnixShell for Zsh {
fn does_exist(&self) -> bool {
// zsh has to either be the shell or be callable for zsh setup.
matches!(process().var("SHELL"), Ok(sh) if sh.contains("zsh"))
|| matches!(utils::find_cmd(&["zsh"]), Some(_))
|| utils::find_cmd(&["zsh"]).is_some()
}

fn rcfiles(&self) -> Vec<PathBuf> {
Expand All @@ -195,7 +195,7 @@ impl UnixShell for Zsh {
self.rcfiles()
.into_iter()
.filter(|env| env.is_file())
.chain(self.rcfiles().into_iter())
.chain(self.rcfiles())
.take(1)
.collect()
}
Expand Down
4 changes: 2 additions & 2 deletions src/env_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mod tests {
let mut vars = HashMap::new();
vars.env(
"PATH",
env::join_paths(vec!["/home/a/.cargo/bin", "/home/b/.cargo/bin"].iter()).unwrap(),
env::join_paths(["/home/a/.cargo/bin", "/home/b/.cargo/bin"].iter()).unwrap(),
);
let tp = currentprocess::TestProcess {
vars,
Expand Down Expand Up @@ -84,7 +84,7 @@ mod tests {
OsStr::new("PATH"),
Some(
env::join_paths(
vec![
[
"/home/z/.cargo/bin",
"/home/a/.cargo/bin",
"/home/b/.cargo/bin"
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
clippy::type_complexity,
clippy::upper_case_acronyms, // see https://github.com/rust-lang/rust-clippy/issues/6974
clippy::vec_init_then_push, // uses two different styles of initialization
clippy::box_default, // its ugly and outside of inner loops irrelevant
clippy::box_default, // its ugly and outside of inner loops irrelevant
clippy::result_large_err, // 288 bytes is our 'large' variant today, which is unlikely to be a performance problem
clippy::arc_with_non_send_sync, // will get resolved as we move further into async
)]
#![recursion_limit = "1024"]

Expand Down
13 changes: 5 additions & 8 deletions src/test/mock/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,14 +1194,11 @@ fn build_mock_channel(
// Convert the mock installers to mock package definitions for the
// mock dist server
let mut all = MockChannelContent::default();
all.std.extend(
vec![
(std, host_triple.clone()),
(cross_std1, CROSS_ARCH1.to_string()),
(cross_std2, CROSS_ARCH2.to_string()),
]
.into_iter(),
);
all.std.extend(vec![
(std, host_triple.clone()),
(cross_std1, CROSS_ARCH1.to_string()),
(cross_std2, CROSS_ARCH2.to_string()),
]);
all.rustc.push((rustc, host_triple.clone()));
all.cargo.push((cargo, host_triple.clone()));

Expand Down
2 changes: 1 addition & 1 deletion src/test/mock/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl MockDistServer {
let mut hashes = HashMap::new();
for package in &channel.packages {
let new_hashes = self.build_package(channel, package, enable_xz, enable_zst);
hashes.extend(new_hashes.into_iter());
hashes.extend(new_hashes);
}
for v in vs {
match *v {
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/cli_rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@ fn non_utf8_arg() {
config.expect_ok(&["rustup", "default", "nightly"]);
let out = config.run(
"rustc",
&[
[
OsStr::new("--echo-args"),
OsStr::new("echoed non-utf8 arg:"),
OsStr::from_bytes(b"\xc3\x28"),
Expand Down Expand Up @@ -2224,7 +2224,7 @@ fn non_utf8_toolchain() {
config.expect_ok(&["rustup", "default", "nightly"]);
let out = config.run(
"rustc",
&[OsStr::from_bytes(b"+\xc3\x28")],
[OsStr::from_bytes(b"+\xc3\x28")],
&[("RUST_BACKTRACE", "1")],
);
assert!(out.stderr.contains("toolchain '�(' is not installable"));
Expand Down

0 comments on commit 87fa15d

Please sign in to comment.