mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 03:23:33 +00:00
58 lines
1.8 KiB
Text
58 lines
1.8 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:35:30
|
|
|
|
|
35 | "abc".chars().filter(|c| c.to_owned() != 'X');
|
|
| ^^^^^^^^^^^^ help: try: `*c`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:42:5
|
|
|
|
|
42 | y.to_owned() == *x;
|
|
| ^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:47:5
|
|
|
|
|
47 | y.to_owned() == **x;
|
|
| ^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:54:9
|
|
|
|
|
54 | self.to_owned() == *other
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
|
|
|
|
error: aborting due to 9 previous errors
|
|
|