diff options
| author | lukeflo | 2025-10-10 18:22:26 +0200 |
|---|---|---|
| committer | lukeflo | 2025-10-10 18:22:26 +0200 |
| commit | 211d556d6dc7132442c90b3ae6ac7485cf30ac5e (patch) | |
| tree | 10efa77b16fcad7a002d13c0c170b29dbeccc681 | |
| parent | 418d2f3874c8e86c4b58143115ee3d4181130f9c (diff) | |
| download | bibiman-211d556d6dc7132442c90b3ae6ac7485cf30ac5e.tar.gz bibiman-211d556d6dc7132442c90b3ae6ac7485cf30ac5e.zip | |
trimming citekey if last field is empty: WIP
| -rw-r--r-- | src/bibiman/citekeys.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bibiman/citekeys.rs b/src/bibiman/citekeys.rs index f7704fb..1f16b48 100644 --- a/src/bibiman/citekeys.rs +++ b/src/bibiman/citekeys.rs @@ -273,7 +273,8 @@ fn formatting_help() { /// Build the citekey from the patterns defined in the config file fn build_citekey(entry: &Entry, pattern_fields: &[String], case: Option<&CitekeyCase>) -> String { let mut new_citekey = String::new(); - for pattern in pattern_fields.iter() { + let fields = pattern_fields.len(); + for (idx, pattern) in pattern_fields.iter().enumerate() { let (field, word_count, char_count, inner_delimiter, trailing_delimiter) = split_formatting_pat(pattern); let formatted_field_str = { |
