more: file status made more idiomatic. (#10151)

as checking for presence and unwrapping looks inefficient.
This commit is contained in:
David CARLIER
2026-01-10 09:51:33 +01:00
committed by GitHub
parent a17e814aea
commit bb88fb2de7
+5 -2
View File
@@ -837,8 +837,11 @@ impl<'a> Pager<'a> {
// Determine progress information to display
// - Show next file name when at EOF and there is a next file
// - Otherwise show percentage of the file read (if available)
let progress_info = if self.eof_reached && self.next_file.is_some() {
format!(" (Next file: {})", self.next_file.unwrap())
let progress_info = if self.eof_reached {
self.next_file
.as_ref()
.map(|next_file| format!(" (Next file: {next_file})"))
.unwrap_or_default()
} else if let Some(file_size) = self.file_size {
// For files, show percentage or END
let position = self