From c84c38544bc6e81f0b0482e4e82b6c95848c1a0c Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 6 Apr 2021 14:54:54 +0530 Subject: apply clippy lints --- src/command.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/command.rs') diff --git a/src/command.rs b/src/command.rs index 383389e..52ff7c8 100644 --- a/src/command.rs +++ b/src/command.rs @@ -111,7 +111,7 @@ impl CommandBox { return; } if let Some(idx) = self.hist_idx { - if !(idx + 1 >= self.history.items.len()) { + if idx + 1 < self.history.items.len() { self.hist_idx = Some(idx + 1); self.text = self.get_from_hist(); self.cursor_end(); @@ -138,6 +138,12 @@ impl CommandBox { } } +impl std::default::Default for CommandBox { + fn default() -> Self { + CommandBox::new() + } +} + #[derive(Debug)] pub struct History { pub items: Vec, -- cgit v1.2.3