mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 17:15:24 +00:00
add arg_name in duplicate argument error msg
This commit is contained in:
parent
63e4a36e27
commit
41f21a7b5d
2 changed files with 6 additions and 6 deletions
|
@ -31,16 +31,16 @@ pub fn validate_arguments(
|
|||
let mut all_arg_names =
|
||||
FxHashSet::with_hasher(Default::default());
|
||||
for arg in all_args {
|
||||
let arg_name = arg.node.arg.clone();
|
||||
let arg_name = &arg.node.arg;
|
||||
if !all_arg_names.insert(arg_name) {
|
||||
return Err(LexicalError {
|
||||
error: LexicalErrorType::DuplicateArgumentError,
|
||||
error: LexicalErrorType::DuplicateArgumentError(arg_name.to_string()),
|
||||
location: arg.location,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(arguments);
|
||||
Ok(arguments)
|
||||
}
|
||||
|
||||
pub fn parse_params(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue