aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid/storage.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2019-11-02 01:25:34 +0100
committerGitHub <noreply@github.com>2019-11-02 01:25:34 +0100
commit356e4186366d11ab0bcb5f25923a92cb3960bc3c (patch)
treef6b9c8f3b4b88de7efa14b9ed27b0b967daedbab /alacritty_terminal/src/grid/storage.rs
parent3e5511a6935127362e809065093717339c70df04 (diff)
downloadalacritty-356e4186366d11ab0bcb5f25923a92cb3960bc3c.tar.gz
alacritty-356e4186366d11ab0bcb5f25923a92cb3960bc3c.zip
Fix clippy warnings
Diffstat (limited to 'alacritty_terminal/src/grid/storage.rs')
-rw-r--r--alacritty_terminal/src/grid/storage.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/alacritty_terminal/src/grid/storage.rs b/alacritty_terminal/src/grid/storage.rs
index b4ff70a2..10091f2a 100644
--- a/alacritty_terminal/src/grid/storage.rs
+++ b/alacritty_terminal/src/grid/storage.rs
@@ -1,3 +1,4 @@
+use std::cmp::Ordering;
/// Wrapper around Vec which supports fast indexing and rotation
///
/// The rotation implemented by grid::Storage is a simple integer addition.
@@ -94,10 +95,10 @@ impl<T> Storage<T> {
T: Clone,
{
let current_history = self.len - (self.visible_lines.0 + 1);
- if history_size > current_history {
- self.grow_lines(history_size - current_history, template_row);
- } else if history_size < current_history {
- self.shrink_lines(current_history - history_size);
+ match history_size.cmp(&current_history) {
+ Ordering::Greater => self.grow_lines(history_size - current_history, template_row),
+ Ordering::Less => self.shrink_lines(current_history - history_size),
+ _ => (),
}
}