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/factory | |
parent | 17ca46e95af38a914197958bbcc1e759865b6005 (diff) |
feat: improve macro error messages
Diffstat (limited to 'macros/src/factory')
-rw-r--r-- | macros/src/factory/declare_default_args.rs | 2 | ||||
-rw-r--r-- | macros/src/factory/macro_args.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/macros/src/factory/declare_default_args.rs b/macros/src/factory/declare_default_args.rs index 03d52bd..46185e3 100644 --- a/macros/src/factory/declare_default_args.rs +++ b/macros/src/factory/declare_default_args.rs @@ -47,7 +47,7 @@ impl Parse for DeclareDefaultFactoryMacroArgs .map(|flag| flag.flag.to_string()) .collect::<Vec<_>>(); - if let Some(dupe_flag_name) = flag_names.iter().find_duplicate() { + if let Some((dupe_flag_name, _)) = flag_names.iter().find_duplicate() { return Err(input.error(format!("Duplicate flag '{dupe_flag_name}'"))); } diff --git a/macros/src/factory/macro_args.rs b/macros/src/factory/macro_args.rs index bd09cdf..64d6e12 100644 --- a/macros/src/factory/macro_args.rs +++ b/macros/src/factory/macro_args.rs @@ -35,7 +35,7 @@ impl Parse for FactoryMacroArgs .map(|flag| flag.flag.to_string()) .collect::<Vec<_>>(); - if let Some(dupe_flag_name) = flag_names.iter().find_duplicate() { + if let Some((dupe_flag_name, _)) = flag_names.iter().find_duplicate() { return Err(input.error(format!("Duplicate flag '{dupe_flag_name}'"))); } |