Skip to content

Commit

Permalink
Merge pull request #2460 from rbtcollins/clippy
Browse files Browse the repository at this point in the history
More clippy coverage recommendations
  • Loading branch information
rbtcollins authored Aug 16, 2020
2 parents 4cbc785 + 7dc33f1 commit 8e987b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Test it: `cargo test`
4. Lint it: `cargo +nightly clippy --all-targets -- -D warnings`
4. Lint it: `cargo +nightly clippy --all --all-targets -- -D warnings`
5. Commit your changes: `git commit -am 'Add some feature'`
6. Push to the branch: `git push origin my-new-feature`
7. Submit a pull request :D
Expand Down Expand Up @@ -69,9 +69,12 @@ clippy is a moving target that can make it hard to merge for little benefit.

We do ask that contributors keep the clippy status clean themselves.

Minimally, run `cargo +nightly clippy --all-targets -- -D warnings` before
Minimally, run `cargo +nightly clippy --all --all-targets -- -D warnings` before
submitting code.

If possible, adding `--all-features` to the command is useful, but will require
additional dependencies like `libcurl-dev`.

Regular contributors or contributors to particularly OS-specific code should
also make sure that their clippy checking is done on at least Linux and Windows,
as OS-conditional code is a common source of unused imports and other small
Expand Down
2 changes: 1 addition & 1 deletion download/tests/download-curl-resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn callback_gets_all_data_as_if_the_download_happened_all_at_once() {
}
Event::DownloadDataReceived(data) => {
for b in data.iter() {
received_in_callback.lock().unwrap().push(b.clone());
received_in_callback.lock().unwrap().push(*b);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion download/tests/download-reqwest-resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn callback_gets_all_data_as_if_the_download_happened_all_at_once() {
}
Event::DownloadDataReceived(data) => {
for b in data.iter() {
received_in_callback.lock().unwrap().push(b.clone());
received_in_callback.lock().unwrap().push(*b);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cli-paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export PATH="$HOME/apple/bin"
expect_ok(config, &INIT_NONE);

for (before, after) in rcs_before.zip(rcs.iter().map(|rc| rc.exists())) {
assert!(before == false);
assert!(!before);
assert_eq!(before, after);
}
});
Expand Down

0 comments on commit 8e987b3

Please sign in to comment.