diff options
author | HampusM <hampus@hampusmat.com> | 2023-01-30 21:29:21 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-01-30 21:29:21 +0100 |
commit | 178267c701c233542078c09fe6b19802f9642dbd (patch) | |
tree | 3d3010806f6509c062ca86dbbbe9c3a6cd2fe547 /macros/src/declare_interface_args.rs | |
parent | 17ca46e95af38a914197958bbcc1e759865b6005 (diff) |
feat: improve macro error messages
Diffstat (limited to 'macros/src/declare_interface_args.rs')
-rw-r--r-- | macros/src/declare_interface_args.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/macros/src/declare_interface_args.rs b/macros/src/declare_interface_args.rs index bc15d2e..c924dca 100644 --- a/macros/src/declare_interface_args.rs +++ b/macros/src/declare_interface_args.rs @@ -40,13 +40,8 @@ impl Parse for DeclareInterfaceArgs } } - let flag_names = flags - .iter() - .map(|flag| flag.flag.to_string()) - .collect::<Vec<_>>(); - - if let Some(dupe_flag_name) = flag_names.iter().find_duplicate() { - return Err(input.error(format!("Duplicate flag '{dupe_flag_name}'"))); + if let Some((dupe_flag, _)) = flags.iter().find_duplicate() { + return Err(input.error(format!("Duplicate flag '{}'", dupe_flag.flag))); } flags |