From: Ian Jackson Date: Fri, 21 May 2021 13:35:55 +0000 (+0100) Subject: termprogress: Rename Null to remove otiose Reporter X-Git-Tag: otter-0.6.0~108 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e6ac233d4c2e1911c932a9baba744f074d26d786;p=otter.git termprogress: Rename Null to remove otiose Reporter Signed-off-by: Ian Jackson --- diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 58bf80d8..b29816eb 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -119,7 +119,7 @@ impl MainOpts { if self.verbose > 0 { termprogress::new() } else { - termprogress::NullReporter::new() + termprogress::Null::new() } } } @@ -1735,7 +1735,7 @@ mod download_bundle { id, }; chan.cmd_withbulk(&cmd, &mut io::empty(), &mut f, - &mut termprogress::NullReporter) + &mut termprogress::Null) .context("download bundle")?; f.flush().context("flush bundle file")?; if let Some((path, tmp)) = path_tmp { diff --git a/src/mgmtchannel.rs b/src/mgmtchannel.rs index 9f9b73e8..f19a5aab 100644 --- a/src/mgmtchannel.rs +++ b/src/mgmtchannel.rs @@ -142,7 +142,7 @@ impl MgmtChannel { #[throws(AE)] pub fn cmd(&mut self, cmd: &MgmtCommand) -> MgmtResponse { self.cmd_withbulk(cmd, &mut io::empty(), &mut io::sink(), - &mut termprogress::NullReporter)? + &mut termprogress::Null)? } pub fn read_inner_mut(&mut self) -> &mut TimedFdReader { diff --git a/src/termprogress.rs b/src/termprogress.rs index 0ab271a4..2ccfa46d 100644 --- a/src/termprogress.rs +++ b/src/termprogress.rs @@ -14,13 +14,13 @@ pub trait Reporter { fn clear(&mut self); } -pub struct NullReporter; -impl NullReporter { - pub fn new() -> Box { Box::new(NullReporter) } +pub struct Null; +impl Null { + pub fn new() -> Box { Box::new(Null) } } #[allow(unused_variables)] -impl Reporter for NullReporter { +impl Reporter for Null { fn report(&mut self, pi: &ProgressInfo<'_>) { } fn clear(&mut self) { } } @@ -56,7 +56,7 @@ pub fn new() -> Box { spinner: 0, }) } else { - Box::new(NullReporter) + Box::new(Null) } }