summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-06-30 10:57:18 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-06-30 10:57:21 +0200
commit32c5ec1e00d5715ca4af25a880162a7a0abcc8d5 (patch)
tree31cc79ef13c5b9927c2cd8ff996ef2eeb2043ca0
parenta21d4b7122e45eced8e1a4bd029ff9c3224267b8 (diff)
downloadimag-32c5ec1e00d5715ca4af25a880162a7a0abcc8d5.zip
imag-32c5ec1e00d5715ca4af25a880162a7a0abcc8d5.tar.gz
Fix: Sort by date, not by id
This patch fixes a bug. We stated in the helptext of the "show" command that when showing several logs, we sort by date. This was not true as we sorted by Id, which also included the name of the log, hence we effectively sorted by name. This patch fixes that. Output is not sorted by date. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/domain/imag-log/src/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs
index 2d0c8b1..58d2573 100644
--- a/bin/domain/imag-log/src/main.rs
+++ b/bin/domain/imag-log/src/main.rs
@@ -173,7 +173,7 @@ fn show(rt: &Runtime) {
})
.filter(|e| e.is_log().map_err_trace_exit_unwrap())
.map(|entry| (entry.diary_id().map_err_trace_exit_unwrap(), entry))
- .sorted_by_key(|tpl| tpl.0.clone())
+ .sorted_by_key(|tpl| tpl.0.get_date_representation())
.into_iter()
.map(|tpl| { debug!("Found entry: {:?}", tpl.1); tpl })
.map(|(id, entry)| {