@@ -3886,13 +3886,14 @@ declare_clippy_lint! {
38863886 pub STR_SPLIT_AT_NEWLINE ,
38873887 pedantic,
38883888 "splitting a trimmed string at hard-coded newlines"
3889-
3889+ }
3890+
38903891declare_clippy_lint ! {
38913892 /// ### 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
38933894 ///
38943895 /// ### 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.
38963897 ///
38973898 /// ### Example
38983899 /// ```no_run
@@ -4318,9 +4319,7 @@ impl Methods {
43184319 ( "assume_init" , [ ] ) => uninit_assumed_init:: check ( cx, expr, recv) ,
43194320 ( "cloned" , [ ] ) => {
43204321 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) ;
43244323 } ,
43254324 ( "collect" , [ ] ) if is_trait_method ( cx, expr, sym:: Iterator ) => {
43264325 needless_collect:: check ( cx, span, expr, recv, call_span) ;
0 commit comments