| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:45:18 |
| | |
| LL | foo_rstr(rstr.as_ref()); |
| | ^^^^^^^^^^^^^ help: try: `rstr` |
| | |
| = note: `-D clippy::useless-asref` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::useless_asref)]` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:48:20 |
| | |
| LL | foo_rslice(rslice.as_ref()); |
| | ^^^^^^^^^^^^^^^ help: try: `rslice` |
| |
| error: this call to `as_mut` does nothing |
| --> tests/ui/useless_asref.rs:53:21 |
| | |
| LL | foo_mrslice(mrslice.as_mut()); |
| | ^^^^^^^^^^^^^^^^ help: try: `mrslice` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:56:20 |
| | |
| LL | foo_rslice(mrslice.as_ref()); |
| | ^^^^^^^^^^^^^^^^ help: try: `mrslice` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:64: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:73:21 |
| | |
| LL | foo_mrslice(mrrrrrslice.as_mut()); |
| | ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:76:20 |
| | |
| LL | foo_rslice(mrrrrrslice.as_ref()); |
| | ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:81:16 |
| | |
| LL | foo_rrrrmr((&&&&MoreRef).as_ref()); |
| | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&&&&MoreRef)` |
| |
| error: this call to `as_mut` does nothing |
| --> tests/ui/useless_asref.rs:132:13 |
| | |
| LL | foo_mrt(mrt.as_mut()); |
| | ^^^^^^^^^^^^ help: try: `mrt` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:135:12 |
| | |
| LL | foo_rt(mrt.as_ref()); |
| | ^^^^^^^^^^^^ help: try: `mrt` |
| |
| error: this call to `as_ref.map(...)` does nothing |
| --> tests/ui/useless_asref.rs:147: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:150: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:153: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:177: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:180: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:183: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:188:9 |
| | |
| LL | Some(1).as_ref().map(|&x| x.clone()); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(1).clone()` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:258:66 |
| | |
| LL | let v: Vec<Cow<'_, str>> = exts.iter().map(|s| Cow::Borrowed(s.as_ref())).collect(); |
| | ^^^^^^^^^^ help: try: `*s` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:271:66 |
| | |
| LL | let v: Vec<Cow<'_, str>> = exts.iter().map(|s| Cow::Borrowed(s.id().as_ref())).collect(); |
| | ^^^^^^^^^^^^^^^ help: try: `s.id()` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:276:32 |
| | |
| LL | .map(|s| Cow::Borrowed(std::convert::identity(s).as_ref())) |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*std::convert::identity(s)` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:282:72 |
| | |
| LL | let v: Vec<Cow<'_, str>> = exts_field.iter().map(|w| Cow::Borrowed(w.0.as_ref())).collect(); |
| | ^^^^^^^^^^^^ help: try: `w.0` |
| |
| error: this call to `as_ref` does nothing |
| --> tests/ui/useless_asref.rs:286:74 |
| | |
| LL | let v: Vec<Cow<'_, str>> = exts_index.iter().map(|arr| Cow::Borrowed(arr[0].as_ref())).collect(); |
| | ^^^^^^^^^^^^^^^ help: try: `arr[0]` |
| |
| error: aborting due to 23 previous errors |
| |