Skip to content

Commit 5f6bec8

Browse files
committed
parser: drive-by: simplify parse_arg_general.
1 parent 95792b4 commit 5f6bec8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -971,15 +971,12 @@ impl<'a> Parser<'a> {
971971
/// Skips unexpected attributes and doc comments in this position and emits an appropriate
972972
/// error.
973973
/// This version of parse arg doesn't necessarily require identifier names.
974-
fn parse_arg_general<F>(
974+
fn parse_arg_general(
975975
&mut self,
976976
is_trait_item: bool,
977977
allow_c_variadic: bool,
978-
is_name_required: F,
979-
) -> PResult<'a, Arg>
980-
where
981-
F: Fn(&token::Token) -> bool
982-
{
978+
is_name_required: impl Fn(&token::Token) -> bool,
979+
) -> PResult<'a, Arg> {
983980
let lo = self.token.span;
984981
let attrs = self.parse_arg_attributes()?;
985982
if let Some(mut arg) = self.parse_self_arg()? {

0 commit comments

Comments
 (0)