@@ -14,7 +14,7 @@ declare_clippy_lint! {
14
14
/// ### What it does
15
15
/// Checks for multiple inherent implementations of a struct
16
16
///
17
- /// The config option controls the scope at which multiple inherent impl blocks for the same
17
+ /// The config option controls the scope in which multiple inherent ` impl` blocks for the same
18
18
/// struct are linted, allowing values of `module` (only within the same module), `file`
19
19
/// (within the same file), or `crate` (anywhere in the crate, default).
20
20
///
@@ -103,31 +103,31 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
103
103
{
104
104
Criterion :: File ( cx. tcx . sess . source_map ( ) . lookup_source_file ( span. lo ( ) ) . name . clone ( ) )
105
105
} else {
106
- // We know we are working on an Impl , so the the pattern matching can
106
+ // We know we are working on an impl , so the pattern matching can
107
107
// not fail
108
108
unreachable ! ( )
109
109
}
110
110
} ,
111
111
InherentImplLintScope :: Crate => Criterion :: Crate ,
112
112
} ;
113
- match type_map. entry ( ( impl_ty, criterion. clone ( ) ) ) {
113
+ match type_map. entry ( ( impl_ty, criterion) ) {
114
114
Entry :: Vacant ( e) => {
115
115
// Store the id for the first impl block of this type. The span is retrieved lazily.
116
- e. insert ( ( IdOrSpan :: Id ( impl_id) , criterion . clone ( ) ) ) ;
116
+ e. insert ( IdOrSpan :: Id ( impl_id) ) ;
117
117
} ,
118
118
Entry :: Occupied ( mut e) => {
119
119
if let Some ( span) = get_impl_span ( cx, impl_id) {
120
- let first_span = match e. get ( ) . 0 {
120
+ let first_span = match * e. get ( ) {
121
121
IdOrSpan :: Span ( s) => s,
122
122
IdOrSpan :: Id ( id) => {
123
123
if let Some ( s) = get_impl_span ( cx, id) {
124
124
// Remember the span of the first block.
125
- * e. get_mut ( ) = ( IdOrSpan :: Span ( s) , criterion . clone ( ) ) ;
125
+ * e. get_mut ( ) = IdOrSpan :: Span ( s) ;
126
126
s
127
127
} else {
128
128
// The first impl block isn't considered by the lint. Replace it with the
129
129
// current one.
130
- * e. get_mut ( ) = ( IdOrSpan :: Span ( span) , criterion . clone ( ) ) ;
130
+ * e. get_mut ( ) = IdOrSpan :: Span ( span) ;
131
131
continue ;
132
132
}
133
133
} ,
0 commit comments