mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 06:30:32 +00:00
116 lines
3.7 KiB
Text
116 lines
3.7 KiB
Text
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:50:18
|
|
|
|
|
LL | foo_rstr(rstr.as_ref());
|
|
| ^^^^^^^^^^^^^ help: try: `rstr`
|
|
|
|
|
note: the lint level is defined here
|
|
--> tests/ui/useless_asref.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::useless_asref)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:52:20
|
|
|
|
|
LL | foo_rslice(rslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^ help: try: `rslice`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> tests/ui/useless_asref.rs:56:21
|
|
|
|
|
LL | foo_mrslice(mrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^ help: try: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:58:20
|
|
|
|
|
LL | foo_rslice(mrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^ help: try: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:65:20
|
|
|
|
|
LL | foo_rslice(rrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `rrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:67:18
|
|
|
|
|
LL | foo_rstr(rrrrrstr.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `rrrrrstr`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> tests/ui/useless_asref.rs:72:21
|
|
|
|
|
LL | foo_mrslice(mrrrrrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:74:20
|
|
|
|
|
LL | foo_rslice(mrrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:78:16
|
|
|
|
|
LL | foo_rrrrmr((&&&&MoreRef).as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&&&&MoreRef)`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> tests/ui/useless_asref.rs:128:13
|
|
|
|
|
LL | foo_mrt(mrt.as_mut());
|
|
| ^^^^^^^^^^^^ help: try: `mrt`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> tests/ui/useless_asref.rs:130:12
|
|
|
|
|
LL | foo_rt(mrt.as_ref());
|
|
| ^^^^^^^^^^^^ help: try: `mrt`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:141:13
|
|
|
|
|
LL | let z = x.as_ref().map(String::clone);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:143:13
|
|
|
|
|
LL | let z = x.as_ref().map(|z| z.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:145:13
|
|
|
|
|
LL | let z = x.as_ref().map(|z| String::clone(z));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:169:9
|
|
|
|
|
LL | x.field.as_ref().map(|v| v.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.field.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:171:9
|
|
|
|
|
LL | x.field.as_ref().map(Clone::clone);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.field.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:173:9
|
|
|
|
|
LL | x.field.as_ref().map(|v| Clone::clone(v));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.field.clone()`
|
|
|
|
error: this call to `as_ref.map(...)` does nothing
|
|
--> tests/ui/useless_asref.rs:178:9
|
|
|
|
|
LL | Some(1).as_ref().map(|&x| x.clone());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(1).clone()`
|
|
|
|
error: aborting due to 18 previous errors
|
|
|