From 2b6f0687841265608ad6b98997910012e6c95369 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 18 Aug 2025 08:00:24 -0300 Subject: [PATCH] refactor: remove unused create() method from MetaPlugin trait Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) --- src/meta_plugin.rs | 1 - src/meta_plugin/digest.rs | 29 ----------------------------- 2 files changed, 30 deletions(-) diff --git a/src/meta_plugin.rs b/src/meta_plugin.rs index fa1238c..8a47de5 100644 --- a/src/meta_plugin.rs +++ b/src/meta_plugin.rs @@ -49,7 +49,6 @@ pub trait MetaPlugin { false } - fn create(&self) -> Result>; fn finalize(&mut self) -> io::Result; // Update the meta plugin with new data diff --git a/src/meta_plugin/digest.rs b/src/meta_plugin/digest.rs index 59142ef..224b957 100644 --- a/src/meta_plugin/digest.rs +++ b/src/meta_plugin/digest.rs @@ -26,12 +26,6 @@ impl MetaPlugin for DigestSha256MetaPlugin { true } - fn create(&self) -> Result> { - // For meta plugins, we don't actually create a writer since we're buffering data internally - // This method is required by the trait but not used in the same way as digest engines - Ok(Box::new(DummyWriter)) - } - fn finalize(&mut self) -> io::Result { let result = self.hasher.clone().finalize(); Ok(format!("{:x}", result)) @@ -46,19 +40,6 @@ impl MetaPlugin for DigestSha256MetaPlugin { } } -// Dummy writer that implements Write but doesn't do anything -// This is needed to satisfy the MetaPlugin trait requirements -struct DummyWriter; - -impl Write for DummyWriter { - fn write(&mut self, buf: &[u8]) -> io::Result { - Ok(buf.len()) - } - - fn flush(&mut self) -> io::Result<()> { - Ok(()) - } -} #[derive(Debug, Clone, Default)] pub struct ReadTimeMetaPlugin { @@ -80,11 +61,6 @@ impl MetaPlugin for ReadTimeMetaPlugin { true } - fn create(&self) -> Result> { - // For meta plugins, we don't actually create a writer since we're buffering data internally - Ok(Box::new(DummyWriter)) - } - fn finalize(&mut self) -> io::Result { if let Some(start_time) = self.start_time { let duration = start_time.elapsed(); @@ -127,11 +103,6 @@ impl MetaPlugin for ReadRateMetaPlugin { true } - fn create(&self) -> Result> { - // For meta plugins, we don't actually create a writer since we're buffering data internally - Ok(Box::new(DummyWriter)) - } - fn finalize(&mut self) -> io::Result { if let Some(start_time) = self.start_time { let duration = start_time.elapsed();