Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Jul 25, 2024
1 parent f2f047c commit 0bee57e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,7 @@ pub fn truncate(s: &'_ str, width: usize) -> Cow<'_, str> {
buf.push(c);
continue;
}
total_width += if let Some(x) = UnicodeWidthChar::width(c) {
x
} else {
0
};
total_width += UnicodeWidthChar::width(c).unwrap_or_default();
if total_width > width {
ret = Some(buf);
break;
Expand Down
4 changes: 2 additions & 2 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ impl View {
+ self.columns.len()
- 1
} else {
std::usize::MIN
usize::MIN
};

let use_builtin_pager = if cfg!(target_os = "windows") {
Expand Down Expand Up @@ -424,7 +424,7 @@ impl View {
truncate |= !use_terminal && config.display.cut_to_pipe;

if !truncate {
self.term_info.width = std::usize::MAX;
self.term_info.width = usize::MAX;
}

match (opt.color.as_ref(), &config.display.color_mode) {
Expand Down

0 comments on commit 0bee57e

Please sign in to comment.