mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
92 lines
2.8 KiB
Text
92 lines
2.8 KiB
Text
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:48:18
|
|
|
|
|
LL | foo_rstr(rstr.as_ref());
|
|
| ^^^^^^^^^^^^^ help: try: `rstr`
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/useless_asref.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::useless_asref)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:50:20
|
|
|
|
|
LL | foo_rslice(rslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^ help: try: `rslice`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:54:21
|
|
|
|
|
LL | foo_mrslice(mrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^ help: try: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:56:20
|
|
|
|
|
LL | foo_rslice(mrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^ help: try: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:63:20
|
|
|
|
|
LL | foo_rslice(rrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `rrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:65:18
|
|
|
|
|
LL | foo_rstr(rrrrrstr.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `rrrrrstr`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:70:21
|
|
|
|
|
LL | foo_mrslice(mrrrrrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:72:20
|
|
|
|
|
LL | foo_rslice(mrrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:76:16
|
|
|
|
|
LL | foo_rrrrmr((&&&&MoreRef).as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&&&&MoreRef)`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:126:13
|
|
|
|
|
LL | foo_mrt(mrt.as_mut());
|
|
| ^^^^^^^^^^^^ help: try: `mrt`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:128:12
|
|
|
|
|
LL | foo_rt(mrt.as_ref());
|
|
| ^^^^^^^^^^^^ help: try: `mrt`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> $DIR/useless_asref.rs:139:13
|
|
|
|
|
LL | let z = x.as_ref().map(String::clone);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> $DIR/useless_asref.rs:141:13
|
|
|
|
|
LL | let z = x.as_ref().map(|z| z.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> $DIR/useless_asref.rs:143:13
|
|
|
|
|
LL | let z = x.as_ref().map(|z| String::clone(z));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
|
|
|
|
error: aborting due to 14 previous errors
|
|
|