mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
more: file status made more idiomatic. (#10151)
as checking for presence and unwrapping looks inefficient.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user