diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 16:26:19 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 16:27:24 +0900 |
| commit | cb2adb32c90b4150c96518ec5be152be70bcb792 (patch) | |
| tree | 053c3309975565133ccca156c876dcf4227ffe8e /crates/shirabe/src/io/null_io.rs | |
| parent | 62c827a7b858796a7f51de3eeff1d6c56c3afe7b (diff) | |
| download | php-shirabe-cb2adb32c90b4150c96518ec5be152be70bcb792.tar.gz php-shirabe-cb2adb32c90b4150c96518ec5be152be70bcb792.tar.zst php-shirabe-cb2adb32c90b4150c96518ec5be152be70bcb792.zip | |
fix(compile): fix IOInterface method signature mismatches
- Change write/write_error/write_raw/write_error_raw/overwrite/
overwrite_error/ask/ask_confirmation/ask_and_validate/
ask_and_hide_answer/select to &mut self in trait and NullIO
- Change ask-family question params from PhpMixed to String in
ConsoleIO, converting to PhpMixed::String internally
- Change ConsoleIO::select choices param from PhpMixed to Vec<String>
- Fix NullIO::load_configuration to use &mut Config and return Result
Diffstat (limited to 'crates/shirabe/src/io/null_io.rs')
| -rw-r--r-- | crates/shirabe/src/io/null_io.rs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/crates/shirabe/src/io/null_io.rs b/crates/shirabe/src/io/null_io.rs index 0399bcb..f229839 100644 --- a/crates/shirabe/src/io/null_io.rs +++ b/crates/shirabe/src/io/null_io.rs @@ -31,14 +31,21 @@ impl IOInterface for NullIO { false } - fn write(&self, _messages: PhpMixed, _newline: bool, _verbosity: i64) {} + fn write(&mut self, _messages: PhpMixed, _newline: bool, _verbosity: i64) {} - fn write_error(&self, _messages: PhpMixed, _newline: bool, _verbosity: i64) {} + fn write_error(&mut self, _messages: PhpMixed, _newline: bool, _verbosity: i64) {} - fn overwrite(&self, _messages: PhpMixed, _newline: bool, _size: Option<i64>, _verbosity: i64) {} + fn overwrite( + &mut self, + _messages: PhpMixed, + _newline: bool, + _size: Option<i64>, + _verbosity: i64, + ) { + } fn overwrite_error( - &self, + &mut self, _messages: PhpMixed, _newline: bool, _size: Option<i64>, @@ -46,16 +53,16 @@ impl IOInterface for NullIO { ) { } - fn ask(&self, _question: String, default: PhpMixed) -> PhpMixed { + fn ask(&mut self, _question: String, default: PhpMixed) -> PhpMixed { default } - fn ask_confirmation(&self, _question: String, default: bool) -> bool { + fn ask_confirmation(&mut self, _question: String, default: bool) -> bool { default } fn ask_and_validate( - &self, + &mut self, _question: String, _validator: Box<dyn Fn(PhpMixed) -> PhpMixed>, _attempts: Option<i64>, @@ -64,12 +71,12 @@ impl IOInterface for NullIO { default } - fn ask_and_hide_answer(&self, _question: String) -> Option<String> { + fn ask_and_hide_answer(&mut self, _question: String) -> Option<String> { None } fn select( - &self, + &mut self, _question: String, _choices: Vec<String>, default: PhpMixed, @@ -80,11 +87,11 @@ impl IOInterface for NullIO { default } - fn write_raw(&self, messages: PhpMixed, newline: bool, verbosity: i64) { + fn write_raw(&mut self, messages: PhpMixed, newline: bool, verbosity: i64) { <Self as BaseIO>::write_raw(self, messages, newline, verbosity) } - fn write_error_raw(&self, messages: PhpMixed, newline: bool, verbosity: i64) { + fn write_error_raw(&mut self, messages: PhpMixed, newline: bool, verbosity: i64) { <Self as BaseIO>::write_error_raw(self, messages, newline, verbosity) } @@ -114,7 +121,7 @@ impl IOInterface for NullIO { <Self as BaseIO>::set_authentication(self, repository_name, username, password) } - fn load_configuration(&mut self, config: &crate::config::Config) { + fn load_configuration(&mut self, config: &mut crate::config::Config) -> anyhow::Result<()> { <Self as BaseIO>::load_configuration(self, config) } } |
