@@ -3886,13 +3886,14 @@ declare_clippy_lint! {
3886
3886
pub STR_SPLIT_AT_NEWLINE ,
3887
3887
pedantic,
3888
3888
"splitting a trimmed string at hard-coded newlines"
3889
-
3889
+ }
3890
+
3890
3891
declare_clippy_lint ! {
3891
3892
/// ### What it does
3892
- /// Checks for usage of `.as_ref().cloned()` on `Option`s
3893
+ /// Checks for usage of `.as_ref().cloned()` and `.as_mut().cloned()` on `Option`s
3893
3894
///
3894
3895
/// ### Why is this bad?
3895
- /// This can be written more concisely by cloning the option directly.
3896
+ /// This can be written more concisely by cloning the `Option` directly.
3896
3897
///
3897
3898
/// ### Example
3898
3899
/// ```no_run
@@ -4318,9 +4319,7 @@ impl Methods {
4318
4319
( "assume_init" , [ ] ) => uninit_assumed_init:: check ( cx, expr, recv) ,
4319
4320
( "cloned" , [ ] ) => {
4320
4321
cloned_instead_of_copied:: check ( cx, expr, recv, span, & self . msrv ) ;
4321
- if let Some ( ( "as_ref" , recv, .., as_ref_ident_span) ) = method_call( recv) {
4322
- option_as_ref_cloned:: check( cx, recv, as_ref_ident_span, span) ;
4323
- }
4322
+ option_as_ref_cloned:: check ( cx, recv, span) ;
4324
4323
} ,
4325
4324
( "collect" , [ ] ) if is_trait_method ( cx, expr, sym:: Iterator ) => {
4326
4325
needless_collect:: check ( cx, span, expr, recv, call_span) ;
0 commit comments