diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2023-01-08 21:30:53 +0100 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2023-03-01 00:33:29 +0100 |
| commit | c40c89bb4edc22c4a60d8677c660a9ab7eb47e92 (patch) | |
| tree | 3ba72592f324dd7bef32773211b093e4949d6ff0 /macros/src/syntax/parse/util.rs | |
| parent | 6d252785e83218eeb5d080836281c90b86ca0e03 (diff) | |
Clippy fixes
Diffstat (limited to 'macros/src/syntax/parse/util.rs')
| -rw-r--r-- | macros/src/syntax/parse/util.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/macros/src/syntax/parse/util.rs b/macros/src/syntax/parse/util.rs index 28c3eac..900ef9d 100644 --- a/macros/src/syntax/parse/util.rs +++ b/macros/src/syntax/parse/util.rs @@ -234,17 +234,13 @@ pub fn parse_local_resources(content: ParseStream<'_>) -> parse::Result<LocalRes pub fn parse_inputs(inputs: Punctuated<FnArg, Token![,]>, name: &str) -> Option<Box<Pat>> { let mut inputs = inputs.into_iter(); - match inputs.next() { - Some(FnArg::Typed(first)) => { - if type_is_path(&first.ty, &[name, "Context"]) { - // No more inputs - if inputs.next().is_none() { - return Some(first.pat); - } + if let Some(FnArg::Typed(first)) = inputs.next() { + if type_is_path(&first.ty, &[name, "Context"]) { + // No more inputs + if inputs.next().is_none() { + return Some(first.pat); } } - - _ => {} } None |
