aboutsummaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-06-26 16:54:11 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-06-26 16:54:11 +0200
commit86e0f74bd7f0301886c1dda0f147b6c8ffbdd707 (patch)
treedb6dc6aa23b05173c33f9ea5345f7871c8ce62b4 /src/output
parent1fb3d3259d23410f8bf9879f64de880a11e4f876 (diff)
parente22b79adaaa69761fc520d6cd57baee1025fa926 (diff)
downloadraidgrep-86e0f74bd7f0301886c1dda0f147b6c8ffbdd707.tar.gz
raidgrep-86e0f74bd7f0301886c1dda0f147b6c8ffbdd707.tar.bz2
raidgrep-86e0f74bd7f0301886c1dda0f147b6c8ffbdd707.zip
Merge branch 'comparison-filters'
Diffstat (limited to 'src/output')
-rw-r--r--src/output/formats.rs3
-rw-r--r--src/output/sorting.rs7
2 files changed, 9 insertions, 1 deletions
diff --git a/src/output/formats.rs b/src/output/formats.rs
index 51de033..560963b 100644
--- a/src/output/formats.rs
+++ b/src/output/formats.rs
@@ -36,7 +36,7 @@ impl Format for HumanReadable {
};
writeln!(
result,
- "{}: {} - {}: {}{} {}",
+ "{}: {} - {}: {}{} {} after {}",
"Date".green(),
item.time
.with_timezone(&Local)
@@ -47,6 +47,7 @@ impl Format for HumanReadable {
.unwrap_or_else(|| "unknown".into()),
if item.is_cm { " CM" } else { "" },
outcome,
+ humantime::Duration::from(item.duration.to_std().unwrap()),
)
.unwrap();
for player in &item.players {
diff --git a/src/output/sorting.rs b/src/output/sorting.rs
index f46a95c..78f3538 100644
--- a/src/output/sorting.rs
+++ b/src/output/sorting.rs
@@ -130,6 +130,7 @@ mod tests {
use super::*;
use chrono::prelude::*;
+ use chrono::Duration;
use evtclib::Boss as B;
#[test]
@@ -163,10 +164,12 @@ mod tests {
fn test_sorting_cmp() {
use Component::*;
+ let duration = Duration::zero();
let logs: &[&LogResult] = &[
&LogResult {
log_file: "".into(),
time: Utc.ymd(2020, 4, 3).and_hms(12, 0, 0),
+ duration,
boss: Some(B::Dhuum),
players: vec![],
outcome: FightOutcome::Success,
@@ -175,6 +178,7 @@ mod tests {
&LogResult {
log_file: "".into(),
time: Utc.ymd(2020, 4, 3).and_hms(13, 0, 0),
+ duration,
boss: Some(B::Dhuum),
players: vec![],
outcome: FightOutcome::Success,
@@ -183,6 +187,7 @@ mod tests {
&LogResult {
log_file: "".into(),
time: Utc.ymd(2020, 4, 3).and_hms(11, 0, 0),
+ duration,
boss: Some(B::Dhuum),
players: vec![],
outcome: FightOutcome::Success,
@@ -191,6 +196,7 @@ mod tests {
&LogResult {
log_file: "".into(),
time: Utc.ymd(2020, 4, 3).and_hms(11, 0, 0),
+ duration,
boss: Some(B::Qadim),
players: vec![],
outcome: FightOutcome::Success,
@@ -199,6 +205,7 @@ mod tests {
&LogResult {
log_file: "".into(),
time: Utc.ymd(2020, 4, 3).and_hms(11, 0, 0),
+ duration,
boss: Some(B::Dhuum),
players: vec![],
outcome: FightOutcome::Success,