mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-14 16:45:25 +00:00
format code
This commit is contained in:
parent
24d2ab8b0a
commit
200390c1ab
1 changed files with 2 additions and 5 deletions
|
@ -10,9 +10,7 @@ pub struct ArgumentList {
|
||||||
type ParameterDefs = (Vec<ast::Arg>, Vec<ast::Arg>, Vec<ast::Expr>);
|
type ParameterDefs = (Vec<ast::Arg>, Vec<ast::Arg>, Vec<ast::Expr>);
|
||||||
type ParameterDef = (ast::Arg, Option<ast::Expr>);
|
type ParameterDef = (ast::Arg, Option<ast::Expr>);
|
||||||
|
|
||||||
pub fn validate_arguments(
|
pub fn validate_arguments(arguments: ast::Arguments) -> Result<ast::Arguments, LexicalError> {
|
||||||
arguments: ast::Arguments
|
|
||||||
) -> Result<ast::Arguments, LexicalError> {
|
|
||||||
let mut all_args: Vec<&ast::Located<ast::ArgData>> = vec![];
|
let mut all_args: Vec<&ast::Located<ast::ArgData>> = vec![];
|
||||||
|
|
||||||
all_args.extend(arguments.posonlyargs.iter());
|
all_args.extend(arguments.posonlyargs.iter());
|
||||||
|
@ -28,8 +26,7 @@ pub fn validate_arguments(
|
||||||
all_args.push(a);
|
all_args.push(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut all_arg_names =
|
let mut all_arg_names = FxHashSet::with_hasher(Default::default());
|
||||||
FxHashSet::with_hasher(Default::default());
|
|
||||||
for arg in all_args {
|
for arg in all_args {
|
||||||
let arg_name = &arg.node.arg;
|
let arg_name = &arg.node.arg;
|
||||||
if !all_arg_names.insert(arg_name) {
|
if !all_arg_names.insert(arg_name) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue