diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-18 22:57:34 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-24 21:53:55 +0200 |
| commit | 5f6bec8ecf5a9018bb368becc0aaea703334795a (patch) | |
| tree | 4e2a672aba3203deb0ae02c4bf0343508029e09e /src/libsyntax/parse | |
| parent | 95792b4d5a12276068e32f54c5d1561b8528a952 (diff) | |
| download | rust-5f6bec8ecf5a9018bb368becc0aaea703334795a.tar.gz rust-5f6bec8ecf5a9018bb368becc0aaea703334795a.zip | |
parser: drive-by: simplify `parse_arg_general`.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 89725d8b339..002e9bccec7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -971,15 +971,12 @@ impl<'a> Parser<'a> { /// Skips unexpected attributes and doc comments in this position and emits an appropriate /// error. /// This version of parse arg doesn't necessarily require identifier names. - fn parse_arg_general<F>( + fn parse_arg_general( &mut self, is_trait_item: bool, allow_c_variadic: bool, - is_name_required: F, - ) -> PResult<'a, Arg> - where - F: Fn(&token::Token) -> bool - { + is_name_required: impl Fn(&token::Token) -> bool, + ) -> PResult<'a, Arg> { let lo = self.token.span; let attrs = self.parse_arg_attributes()?; if let Some(mut arg) = self.parse_self_arg()? { |
