From 4c59e4616ddded70983a77dbcfff947c9156ab28 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Fri, 2 Mar 2018 06:52:36 +0000 Subject: [PATCH] adds HistLog::new_with_tag --- src/hist.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hist.rs b/src/hist.rs index 2eeca57..503ee67 100644 --- a/src/hist.rs +++ b/src/hist.rs @@ -61,7 +61,11 @@ impl HistLog { Self { series, tag, freq, last_sent, tx, hist, thread } } - pub fn clone_with_tag(&self, tag: &'static str) -> HistLog { + pub fn new_with_tag(&self, tag: &'static str) -> Self { + Self::new(self.series, tag, self.freq) + } + + pub fn clone_with_tag(&self, tag: &'static str) -> Self { let thread = self.thread.as_ref().map(|x| Arc::clone(x)).unwrap(); assert!(self.thread.is_some(), "self.thread is {:?}", self.thread); let tx = self.tx.clone();