Skip to content

Commit 7d4b5df

Browse files
committed
Make library created with cargo new clippy happy
Signed-off-by: hi-rustin <[email protected]>
1 parent 649822b commit 7d4b5df

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/cargo/ops/cargo_new.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ fn main() {
812812
mod tests {
813813
#[test]
814814
fn it_works() {
815-
assert_eq!(2 + 2, 4);
815+
let result = 2 + 2;
816+
assert_eq!(result, 4);
816817
}
817818
}
818819
"

tests/testsuite/init.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,8 @@ fn formats_source() {
572572
mod tests {
573573
#[test]
574574
fn it_works() {
575-
assert_eq!(2 + 2, 4);
575+
let result = 2 + 2;
576+
assert_eq!(result, 4);
576577
}
577578
}
578579
"#
@@ -592,7 +593,8 @@ fn ignores_failure_to_format_source() {
592593
mod tests {
593594
#[test]
594595
fn it_works() {
595-
assert_eq!(2 + 2, 4);
596+
let result = 2 + 2;
597+
assert_eq!(result, 4);
596598
}
597599
}
598600
"#

tests/testsuite/new.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ fn simple_lib() {
3131
mod tests {
3232
#[test]
3333
fn it_works() {
34-
assert_eq!(2 + 2, 4);
34+
let result = 2 + 2;
35+
assert_eq!(result, 4);
3536
}
3637
}
3738
"#

0 commit comments

Comments
 (0)