parser: drive-by: simplify parse_arg_general
.
This commit is contained in:
parent
95792b4d5a
commit
5f6bec8ecf
1 changed files with 3 additions and 6 deletions
|
@ -971,15 +971,12 @@ impl<'a> Parser<'a> {
|
||||||
/// Skips unexpected attributes and doc comments in this position and emits an appropriate
|
/// Skips unexpected attributes and doc comments in this position and emits an appropriate
|
||||||
/// error.
|
/// error.
|
||||||
/// This version of parse arg doesn't necessarily require identifier names.
|
/// This version of parse arg doesn't necessarily require identifier names.
|
||||||
fn parse_arg_general<F>(
|
fn parse_arg_general(
|
||||||
&mut self,
|
&mut self,
|
||||||
is_trait_item: bool,
|
is_trait_item: bool,
|
||||||
allow_c_variadic: bool,
|
allow_c_variadic: bool,
|
||||||
is_name_required: F,
|
is_name_required: impl Fn(&token::Token) -> bool,
|
||||||
) -> PResult<'a, Arg>
|
) -> PResult<'a, Arg> {
|
||||||
where
|
|
||||||
F: Fn(&token::Token) -> bool
|
|
||||||
{
|
|
||||||
let lo = self.token.span;
|
let lo = self.token.span;
|
||||||
let attrs = self.parse_arg_attributes()?;
|
let attrs = self.parse_arg_attributes()?;
|
||||||
if let Some(mut arg) = self.parse_self_arg()? {
|
if let Some(mut arg) = self.parse_self_arg()? {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue