Skip to content

Commit

Permalink
Ignore clippy::redundant_clone lint in example
Browse files Browse the repository at this point in the history
rust-lang/rust-clippy#10545

```
warning: redundant clone
  --> examples/const_fn/src/lib.rs:25:38
   |
25 |     let mut function = const_function.clone();
   |                                      ^^^^^^^^ help: remove this
   |
note: cloned value is neither consumed nor mutated
  --> examples/const_fn/src/lib.rs:25:24
   |
25 |     let mut function = const_function.clone();
   |                        ^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
   = note: `#[warn(clippy::redundant_clone)]` on by default
```
  • Loading branch information
taiki-e committed Mar 25, 2023
1 parent 23d100b commit 474876b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/const_fn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn const_fn(args: TokenStream, function: TokenStream) -> TokenStream {
.into();
}

#[allow(clippy::redundant_clone)] // https://github.com/rust-lang/rust-clippy/issues/10545
let mut function = const_function.clone();
function.sig.constness = None;

Expand Down

0 comments on commit 474876b

Please sign in to comment.