Skip to content

Commit 70431de

Browse files
committed
cleanup: reduce ops
1 parent 78c7a5e commit 70431de

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

fyi_msg/src/msg/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,9 @@ impl Msg {
690690
pub fn set_timestamp(&mut self, enabled: bool) {
691691
if enabled {
692692
let now = utc2k::FmtUtc2k::now_local();
693-
let now_s = now.as_str();
694-
let mut out = String::with_capacity(24 + now_s.len());
695-
out.push_str(csi!(dim));
696-
out.push('[');
697-
out.push_str(csi!(reset, blue));
698-
out.push_str(now_s);
693+
let mut out = String::with_capacity(43);
694+
out.push_str(concat!(csi!(dim), "[", csi!(reset, blue)));
695+
out.push_str(now.as_str());
699696
out.push_str(concat!(ansi!((reset, dim) "]"), " "));
700697
self.replace_part(TocId::Timestamp, &out);
701698
}

0 commit comments

Comments
 (0)