Skip to content

Commit

Permalink
Ignore expected unnecessary_wraps pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: this function's return value is unnecessarily wrapped by `Result`
       --> impl/src/fmt.rs:122:1
        |
    122 | / fn explicit_named_args(input: ParseStream) -> Result<Set<Ident>> {
    123 | |     let ahead = input.fork();
    124 | |     if let Ok(set) = try_explicit_named_args(&ahead) {
    125 | |         input.advance_to(&ahead);
    ...   |
    136 | |     Ok(Set::new())
    137 | | }
        | |_^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
        = note: `-W clippy::unnecessary-wraps` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_wraps)]`
    help: remove `Result` from the return type...
        |
    122 | fn explicit_named_args(input: ParseStream) -> std::collections::BTreeSet<proc_macro2::Ident> {
        |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    help: ...and then change returning expressions
        |
    126 ~         return set;
    127 |     }
    ...
    131 |         input.advance_to(&ahead);
    132 ~         return set;
    133 |     }
    134 |
    135 |     input.parse::<TokenStream>().unwrap();
    136 ~     Set::new()
        |
  • Loading branch information
dtolnay committed Nov 3, 2024
1 parent c357f97 commit 0ab908a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions impl/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ impl Display<'_> {
}
}

#[allow(clippy::unnecessary_wraps)]
fn explicit_named_args(input: ParseStream) -> Result<Set<Ident>> {
let ahead = input.fork();
if let Ok(set) = try_explicit_named_args(&ahead) {
Expand Down

0 comments on commit 0ab908a

Please sign in to comment.