Skip to content

Commit

Permalink
Auto merge of #9796 - hi-rustin:rustin-patch-clippy, r=ehuss
Browse files Browse the repository at this point in the history
Make library created with `cargo new` clippy happy

close #9759
  • Loading branch information
bors committed Sep 1, 2021
2 parents 74d7f07 + 7d4b5df commit dd474f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,8 @@ fn main() {
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
let result = 2 + 2;
assert_eq!(result, 4);
}
}
"
Expand Down
6 changes: 4 additions & 2 deletions tests/testsuite/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ fn formats_source() {
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
let result = 2 + 2;
assert_eq!(result, 4);
}
}
"#
Expand All @@ -592,7 +593,8 @@ fn ignores_failure_to_format_source() {
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
let result = 2 + 2;
assert_eq!(result, 4);
}
}
"#
Expand Down
3 changes: 2 additions & 1 deletion tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ fn simple_lib() {
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
let result = 2 + 2;
assert_eq!(result, 4);
}
}
"#
Expand Down

0 comments on commit dd474f8

Please sign in to comment.