Skip to content

Commit

Permalink
Resolve needless_borrow clippy lint
Browse files Browse the repository at this point in the history
    error: this expression borrows a reference (`&syn::FieldsNamed`) that is immediately dereferenced by the compiler
      --> derive/src/ser.rs:13:37
       |
    13 |         }) => derive_struct(&input, &fields),
       |                                     ^^^^^^^ help: change this to: `fields`
       |
       = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
  • Loading branch information
dtolnay committed Jun 5, 2021
1 parent a87e964 commit 5b99beb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion derive/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn derive(input: DeriveInput) -> Result<TokenStream> {
Data::Struct(DataStruct {
fields: Fields::Named(fields),
..
}) => derive_struct(&input, &fields),
}) => derive_struct(&input, fields),
Data::Enum(enumeration) => derive_enum(&input, enumeration),
_ => Err(Error::new(
Span::call_site(),
Expand Down

0 comments on commit 5b99beb

Please sign in to comment.