Skip to content

Commit

Permalink
Resolve needless_return clippy lint in PR 2553
Browse files Browse the repository at this point in the history
    warning: unneeded `return` statement
        --> serde_derive/src/de.rs:2986:13
         |
    2986 |             return quote!(#assign_to __default.#member);
         |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
         = note: `-W clippy::needless-return` implied by `-W clippy::all`
    help: remove `return`
         |
    2986 -             return quote!(#assign_to __default.#member);
    2986 +             quote!(#assign_to __default.#member)
         |
  • Loading branch information
dtolnay committed Aug 6, 2023
1 parent bd7b0e2 commit fc273c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serde_derive/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,7 @@ fn expr_is_missing_seq(
match *cattrs.default() {
attr::Default::Default | attr::Default::Path(_) => {
let member = &field.member;
return quote!(#assign_to __default.#member);
quote!(#assign_to __default.#member)
}
attr::Default::None => quote!(
return _serde::__private::Err(_serde::de::Error::invalid_length(#index, &#expecting))
Expand Down

0 comments on commit fc273c6

Please sign in to comment.