This commit is contained in:
parent
6632d63239
commit
f916787962
1 changed files with 5 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue