From 41116149ca66865ec2ccb251f7355de8878c8576 Mon Sep 17 00:00:00 2001 From: Bruce D'Arcus Date: Tue, 20 Jan 2026 16:56:02 -0500 Subject: [PATCH] fix(clippy): resolve warnings --- csln/src/bibliography/reference.rs | 5 +++-- processor/benches/proc_bench.rs | 1 + processor/tests/processor_test.rs | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/csln/src/bibliography/reference.rs b/csln/src/bibliography/reference.rs index 84bbd01..e097b09 100644 --- a/csln/src/bibliography/reference.rs +++ b/csln/src/bibliography/reference.rs @@ -691,8 +691,9 @@ impl Contributor { let names = self.names(Config::default(), false); let mut result = names; if result.len() > 1 { - let last = result.pop().expect("List should have at least one element"); - result.push(format!("{} {}", and, last)); + if let Some(last) = result.pop() { + result.push(format!("{} {}", and, last)); + } } result } diff --git a/processor/benches/proc_bench.rs b/processor/benches/proc_bench.rs index ee44f3f..b383a0f 100644 --- a/processor/benches/proc_bench.rs +++ b/processor/benches/proc_bench.rs @@ -1,3 +1,4 @@ +#![allow(clippy::expect_used)] use criterion::{criterion_group, criterion_main, Criterion}; use csln::bibliography::InputBibliography as Bibliography; use csln::citation::Citation; diff --git a/processor/tests/processor_test.rs b/processor/tests/processor_test.rs index 9adc420..05e37ac 100644 --- a/processor/tests/processor_test.rs +++ b/processor/tests/processor_test.rs @@ -1,3 +1,4 @@ +#![allow(clippy::unwrap_used, clippy::expect_used)] #[cfg(test)] mod tests { use anyhow::Context;