chore: refactor some code.
Some checks failed
CI / test (pull_request) Failing after 1m50s

This commit is contained in:
Austin Schaefer 2026-08-19 17:04:10 +02:00
parent 6632d63239
commit f916787962

View file

@ -26,10 +26,11 @@ impl Document {
/// retrieved excerpts can be traced back to their position in the
/// source file.
fn from_chunk(path: &Path, index: usize, chunk: &str, total: usize) -> Self {
let source = if total > 1 {
format!("{} (part {}/{total})", path.display(), index + 1)
} else {
path.display().to_string()
let source = match total {
total_chunks if total_chunks > 1 => {
format!("{} (part {}/{total})", path.display(), index + 1)
}
_ => path.display().to_string(),
};
Self {