From 211d556d6dc7132442c90b3ae6ac7485cf30ac5e Mon Sep 17 00:00:00 2001 From: lukeflo Date: Fri, 10 Oct 2025 18:22:26 +0200 Subject: trimming citekey if last field is empty: WIP --- src/bibiman/citekeys.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 = { -- cgit v1.2.3