mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
clean tests/ui/cmp_owned.rs
Cleaning the empty lines for clarity.
This commit is contained in:
parent
17284bacee
commit
ed713d67d6
2 changed files with 6 additions and 8 deletions
|
@ -7,9 +7,7 @@ fn main() {
|
|||
fn with_to_string(x : &str) {
|
||||
x != "foo".to_string();
|
||||
|
||||
|
||||
"foo".to_string() != x;
|
||||
|
||||
}
|
||||
|
||||
let x = "oh";
|
||||
|
|
|
@ -11,21 +11,21 @@ note: lint level defined here
|
|||
| ^^^^^^^^^
|
||||
|
||||
error: this creates an owned instance just for comparison. Consider using `"foo" != x` to compare without allocation
|
||||
--> $DIR/cmp_owned.rs:11:9
|
||||
--> $DIR/cmp_owned.rs:10:9
|
||||
|
|
||||
11 | "foo".to_string() != x;
|
||||
10 | "foo".to_string() != x;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this creates an owned instance just for comparison. Consider using `x != "foo"` to compare without allocation
|
||||
--> $DIR/cmp_owned.rs:19:10
|
||||
--> $DIR/cmp_owned.rs:17:10
|
||||
|
|
||||
19 | x != "foo".to_owned();
|
||||
17 | x != "foo".to_owned();
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: this creates an owned instance just for comparison. Consider using `x != "foo"` to compare without allocation
|
||||
--> $DIR/cmp_owned.rs:24:10
|
||||
--> $DIR/cmp_owned.rs:22:10
|
||||
|
|
||||
24 | x != String::from("foo");
|
||||
22 | x != String::from("foo");
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
|
Loading…
Reference in a new issue