Skip to content

Commit

Permalink
Resolve cloned_instead_of_copied pednatic clippy lint
Browse files Browse the repository at this point in the history
    warning: used `cloned` where `copied` could be used instead
      --> src/de.rs:46:29
       |
    46 |         self.tokens.first().cloned()
       |                             ^^^^^^ help: try: `copied`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied
       = note: `-W clippy::cloned-instead-of-copied` implied by `-W clippy::pedantic`
  • Loading branch information
dtolnay committed Jul 26, 2023
1 parent 712b4e2 commit 8f63fea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<'de> Deserializer<'de> {
}

fn peek_token_opt(&self) -> Option<Token> {
self.tokens.first().cloned()
self.tokens.first().copied()
}

fn peek_token(&self) -> Result<Token, Error> {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
#![allow(clippy::float_cmp, clippy::needless_doctest_main)]
// Ignored clippy_pedantic lints
#![allow(
clippy::cloned_instead_of_copied,
clippy::manual_assert,
clippy::missing_panics_doc,
clippy::module_name_repetitions,
Expand Down

0 comments on commit 8f63fea

Please sign in to comment.