chiark / gitweb /
termprogress: Rename Null to remove otiose Reporter
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 May 2021 13:35:55 +0000 (14:35 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 May 2021 13:35:55 +0000 (14:35 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/otter.rs
src/mgmtchannel.rs
src/termprogress.rs

index 58bf80d88c4b1fd1f2564cbc7367a1c481e5e189..b29816ebbe538222b1ca1e1b3539a9b1b3651b9c 100644 (file)
@@ -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 {
index 9f9b73e892c0e8bd193f45bb8a3c98c6ea703117..f19a5aab827262ae382fc01744a288482ff22af2 100644 (file)
@@ -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 {
index 0ab271a4637236ae1b720e051c1adfbb8a301848..2ccfa46d8848a5a88d47ef04b9bfa0605305f5c7 100644 (file)
@@ -14,13 +14,13 @@ pub trait Reporter {
   fn clear(&mut self);
 }
 
-pub struct NullReporter;
-impl NullReporter {
-  pub fn new() -> Box<dyn Reporter> { Box::new(NullReporter) }
+pub struct Null;
+impl Null {
+  pub fn new() -> Box<dyn Reporter> { 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<dyn Reporter> {
       spinner: 0,
     })
   } else {
-    Box::new(NullReporter)
+    Box::new(Null)
   }
 }