mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
40 lines
1.2 KiB
Text
40 lines
1.2 KiB
Text
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:18:14
|
|
|
|
|
18 | x != "foo".to_string();
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
|
= note: `-D clippy::cmp-owned` implied by `-D warnings`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:20:9
|
|
|
|
|
20 | "foo".to_string() != x;
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:27:10
|
|
|
|
|
27 | x != "foo".to_owned();
|
|
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:29:10
|
|
|
|
|
29 | x != String::from("foo");
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:33:5
|
|
|
|
|
33 | Foo.to_owned() == Foo;
|
|
| ^^^^^^^^^^^^^^ help: try: `Foo`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:40:9
|
|
|
|
|
40 | self.to_owned() == *other
|
|
| ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
|
|
|
|
error: aborting due to 6 previous errors
|
|
|