From f411daceacad66e0bd774fda7d3c5ef8533cc55c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 26 May 2026 20:04:02 +0900 Subject: refactor(io): share IOInterface via Rc> handle Co-Authored-By: Claude Opus 4.7 --- crates/shirabe/src/io/null_io.rs | 59 +++++++++++++--------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) (limited to 'crates/shirabe/src/io/null_io.rs') diff --git a/crates/shirabe/src/io/null_io.rs b/crates/shirabe/src/io/null_io.rs index e3cfdcf..b0e11f1 100644 --- a/crates/shirabe/src/io/null_io.rs +++ b/crates/shirabe/src/io/null_io.rs @@ -2,7 +2,8 @@ use crate::io::BaseIO; use crate::io::IOInterface; -use shirabe_external_packages::psr::log::LoggerInterface; +use crate::io::IOInterfaceImmutable; +use crate::io::IOInterfaceMutable; use shirabe_php_shim::PhpMixed; #[derive(Debug)] @@ -18,7 +19,7 @@ impl NullIO { } } -impl IOInterface for NullIO { +impl IOInterfaceImmutable for NullIO { fn is_interactive(&self) -> bool { false } @@ -109,6 +110,20 @@ impl IOInterface for NullIO { ::get_authentication(self, repository_name) } + fn error(&self, _message: &str, _context: &[(&str, &str)]) { + todo!() + } + + fn warning(&self, _message: &str, _context: &[(&str, &str)]) { + todo!() + } + + fn debug(&self, _message: &str, _context: &[(&str, &str)]) { + todo!() + } +} + +impl IOInterfaceMutable for NullIO { fn set_authentication( &mut self, repository_name: String, @@ -123,6 +138,8 @@ impl IOInterface for NullIO { } } +impl IOInterface for NullIO {} + impl BaseIO for NullIO { fn authentications( &self, @@ -136,41 +153,3 @@ impl BaseIO for NullIO { &mut self.authentications } } - -impl LoggerInterface for NullIO { - fn emergency(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn alert(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn critical(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn error(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn warning(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn notice(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn info(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn debug(&self, message: &str, context: &[(&str, &str)]) { - todo!() - } - - fn log(&self, level: &str, message: &str, context: &[(&str, &str)]) { - todo!() - } -} -- cgit v1.3.1