From 02c70deecba955c1b01f661ed7a709038e90addc Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Fri, 22 Apr 2022 19:24:38 +0100 Subject: refactor (#327) --- src/command/client/history.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/command/client/history.rs') diff --git a/src/command/client/history.rs b/src/command/client/history.rs index 6eaa6407..b2f68f93 100644 --- a/src/command/client/history.rs +++ b/src/command/client/history.rs @@ -55,7 +55,7 @@ pub enum Cmd { pub fn print_list(h: &[History], human: bool, cmd_only: bool) { let mut writer = TabWriter::new(std::io::stdout()).padding(2); - let lines = h.iter().map(|h| { + let lines = h.iter().rev().map(|h| { if human { let duration = humantime::format_duration(Duration::from_nanos(std::cmp::max( h.duration, 0, @@ -82,7 +82,7 @@ pub fn print_list(h: &[History], human: bool, cmd_only: bool) { } }); - for i in lines.rev() { + for i in lines { writer .write_all(i.as_bytes()) .expect("failed to write to tab writer"); -- cgit v1.3.1