refactor: remove unused MetaPluginType::None and related code

This commit is contained in:
Andrew Phillips
2025-05-22 13:21:10 -03:00
committed by Andrew Phillips (aider)
parent 08001aa2d0
commit 25e41c46a9
4 changed files with 2 additions and 71 deletions

View File

@@ -1,43 +0,0 @@
use anyhow::Result;
use log::*;
use std::io::{self, Write};
#[derive(Debug, Eq, PartialEq, Clone, Default)]
pub struct MetaPluginNone {}
impl MetaPluginNone {
pub fn new() -> MetaPluginNone {
MetaPluginNone {}
}
}
impl MetaPlugin for MetaPluginNone {
fn create(&self) -> Result<Box<dyn Write>> {
Ok(Box::new(DummyWriter::new()))
}
fn finalize(&mut self) -> io::Result<String> {
Ok("none".to_string())
}
fn update(&mut self, _data: &[u8]) {}
}
// Dummy writer that implements Write for the none meta plugin
struct DummyWriter;
impl DummyWriter {
fn new() -> Self {
DummyWriter
}
}
impl Write for DummyWriter {
fn write(&mut self, _buf: &[u8]) -> io::Result<usize> {
Ok(0)
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}