From 37b5168bfeb4e69c1439c1e5ef95ecb14cf7f82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E7=A5=AF=E6=99=96?= Date: Wed, 11 Sep 2019 20:43:40 +0800 Subject: [PATCH] fix: Fixups for #138 (#343) - Fix unused imports in unit tests - Add accidently remove module "battery" --- src/modules/time.rs | 3 ++- src/print.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/time.rs b/src/modules/time.rs index d76a5c1e..bf1857c4 100644 --- a/src/modules/time.rs +++ b/src/modules/time.rs @@ -1,5 +1,4 @@ use ansi_term::Color; -use chrono::offset::TimeZone; use chrono::{DateTime, Local}; use super::{Context, Module}; @@ -51,6 +50,7 @@ tests become extra important */ #[cfg(test)] mod tests { use super::*; + use chrono::offset::TimeZone; const FMT_12: &str = "%r"; const FMT_24: &str = "%T"; @@ -97,6 +97,7 @@ mod tests { assert_eq!(formatted, "15:36:47"); } + #[test] fn test_format_with_paren() { let time = Local.ymd(2014, 7, 8).and_hms(15, 36, 47); let formatted = format_time("[%T]", time); diff --git a/src/print.rs b/src/print.rs index f2301ca2..6faf13ce 100644 --- a/src/print.rs +++ b/src/print.rs @@ -29,6 +29,7 @@ const DEFAULT_PROMPT_ORDER: &[&str] = &[ "line_break", "jobs", #[cfg(feature = "battery")] + "battery", "time", "character", ];