minor reductions

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-17 04:57:41 +00:00
parent 1c0ed91f6f
commit 98d96b89a5
2 changed files with 23 additions and 18 deletions

View file

@ -167,10 +167,16 @@ impl Console {
}
fn set_history(&self, readline: &mut Readline) {
let history = self.history.lock().expect("locked");
for entry in history.iter().rev() {
readline.add_history_entry(entry.clone());
}
self.history
.lock()
.expect("locked")
.iter()
.rev()
.for_each(|entry| {
readline
.add_history_entry(entry.clone())
.expect("added history entry");
});
}
fn add_history(&self, line: String) {