Skip to content

Commit 416f4e9

Browse files
authored
Merge pull request #1610 from k-nasa/fix_clippy_warning
Fixed according to warning of clippy
2 parents ab224e4 + dc38cab commit 416f4e9

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/rustup-mock/src/clitools.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub fn setup(s: Scenario, f: &Fn(&mut Config)) {
9999
distdir: distdir.path().to_owned(),
100100
rustupdir: rustupdir.path().to_owned(),
101101
customdir: customdir.path().to_owned(),
102-
cargodir: cargodir,
102+
cargodir,
103103
homedir: homedir.path().to_owned(),
104104
emptydir: emptydir.path().to_owned(),
105105
workdir: RefCell::new(workdir.path().to_owned()),
@@ -363,10 +363,12 @@ where
363363
stdout: String::from_utf8(out.stdout).unwrap(),
364364
stderr: String::from_utf8(out.stderr).unwrap(),
365365
};
366+
366367
println!("status: {}", out.status);
367368
println!("----- stdout\n{}", output.stdout);
368369
println!("----- stderr\n{}", output.stderr);
369-
return output;
370+
371+
output
370372
}
371373

372374
// Creates a mock dist server populated with some test data
@@ -566,12 +568,12 @@ fn build_mock_channel(
566568
available: true,
567569
components: vec![],
568570
extensions: vec![],
569-
installer: installer,
571+
installer,
570572
});
571573

572574
MockPackage {
573-
name: name,
574-
version: version,
575+
name,
576+
version,
575577
targets: target_pkgs.collect(),
576578
}
577579
});
@@ -636,7 +638,7 @@ fn build_mock_channel(
636638
MockChannel {
637639
name: channel.to_string(),
638640
date: date.to_string(),
639-
packages: packages,
641+
packages,
640642
renames,
641643
}
642644
}

src/rustup-mock/src/dist.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn change_channel_date(dist_server: &Url, channel: &str, date: &str) {
6060
}
6161

6262
// The manifest version created by this mock
63-
pub const MOCK_MANIFEST_VERSION: &'static str = "2";
63+
pub const MOCK_MANIFEST_VERSION: &str = "2";
6464

6565
// A mock Rust v2 distribution server. Create it and and run `write`
6666
// to write its structure to a directory.
@@ -167,7 +167,7 @@ impl MockDistServer {
167167
);
168168
}
169169

170-
return hashes;
170+
hashes
171171
}
172172

173173
// Returns the hash of the tarball

src/rustup-mock/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ impl MockFile {
105105

106106
fn _new(path: String, contents: Arc<Vec<u8>>) -> MockFile {
107107
MockFile {
108-
path: path,
108+
path,
109109
contents: Contents::File(MockContents {
110-
contents: contents,
110+
contents,
111111
executable: false,
112112
}),
113113
}

0 commit comments

Comments
 (0)