2024-01-11 10:27:03 -06:00
|
|
|
error: cloning an `Option<_>` using `.as_ref().cloned()`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/option_as_ref_cloned.rs:7:31
|
2024-01-11 10:27:03 -06:00
|
|
|
|
|
|
|
|
LL | let _: Option<String> = x.as_ref().cloned();
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::option-as-ref-cloned` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::option_as_ref_cloned)]`
|
|
|
|
help: this can be written more concisely by cloning the `Option<_>` directly
|
|
|
|
|
|
|
|
|
LL | let _: Option<String> = x.clone();
|
|
|
|
| ~~~~~
|
|
|
|
|
|
|
|
error: cloning an `Option<_>` using `.as_mut().cloned()`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/option_as_ref_cloned.rs:8:31
|
2024-01-11 10:27:03 -06:00
|
|
|
|
|
|
|
|
LL | let _: Option<String> = x.as_mut().cloned();
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: this can be written more concisely by cloning the `Option<_>` directly
|
|
|
|
|
|
|
|
|
LL | let _: Option<String> = x.clone();
|
|
|
|
| ~~~~~
|
|
|
|
|
|
|
|
error: cloning an `Option<_>` using `.as_ref().cloned()`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/option_as_ref_cloned.rs:11:32
|
2024-01-11 10:27:03 -06:00
|
|
|
|
|
|
|
|
LL | let _: Option<&String> = y.as_ref().cloned();
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: this can be written more concisely by cloning the `Option<_>` directly
|
|
|
|
|
|
|
|
|
LL | let _: Option<&String> = y.clone();
|
|
|
|
| ~~~~~
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|