aboutsummaryrefslogtreecommitdiff
path: root/src/command.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-06 10:24:54 +0100
committerAkshay <[email protected]>2021-04-06 10:24:54 +0100
commitc84c38544bc6e81f0b0482e4e82b6c95848c1a0c (patch)
tree3ae2f3387ba5ef56a7f7c3304dc029ae7845f175 /src/command.rs
parent3f5b917c6ced370d940774b51ff89cec0d03c562 (diff)
apply clippy lints
Diffstat (limited to 'src/command.rs')
-rw-r--r--src/command.rs8
1 files changed, 7 insertions, 1 deletions
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 {
111 return; 111 return;
112 } 112 }
113 if let Some(idx) = self.hist_idx { 113 if let Some(idx) = self.hist_idx {
114 if !(idx + 1 >= self.history.items.len()) { 114 if idx + 1 < self.history.items.len() {
115 self.hist_idx = Some(idx + 1); 115 self.hist_idx = Some(idx + 1);
116 self.text = self.get_from_hist(); 116 self.text = self.get_from_hist();
117 self.cursor_end(); 117 self.cursor_end();
@@ -138,6 +138,12 @@ impl CommandBox {
138 } 138 }
139} 139}
140 140
141impl std::default::Default for CommandBox {
142 fn default() -> Self {
143 CommandBox::new()
144 }
145}
146
141#[derive(Debug)] 147#[derive(Debug)]
142pub struct History<T> { 148pub struct History<T> {
143 pub items: Vec<T>, 149 pub items: Vec<T>,