diff options
Diffstat (limited to 'crates/shirabe/src/command/validate_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/validate_command.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/shirabe/src/command/validate_command.rs b/crates/shirabe/src/command/validate_command.rs index 814f09f..cb8fa89 100644 --- a/crates/shirabe/src/command/validate_command.rs +++ b/crates/shirabe/src/command/validate_command.rs @@ -119,8 +119,9 @@ impl ValidateCommand { .map(Ok) .unwrap_or_else(Factory::get_composer_file)?; // TODO(phase-b): get_io() takes &mut self via BaseCommand; clone_box to release the borrow. - let io_box = self.get_io().clone_box(); - let io: &dyn IOInterface = io_box.as_ref(); + let io_box = self.get_io().clone(); + let io_ref = io_box.borrow(); + let io: &dyn IOInterface = &*io_ref; if !std::path::Path::new(&file).exists() { io.write_error(&format!("<error>{} not found.</error>", file)); @@ -131,7 +132,7 @@ impl ValidateCommand { return Ok(3); } - let validator = ConfigValidator::new(io.clone_box()); + let validator = ConfigValidator::new(io_box.clone()); let check_all = if input.get_option("no-check-all").as_bool().unwrap_or(false) { 0 } else { @@ -156,7 +157,7 @@ impl ValidateCommand { validator.validate(&file, check_all, check_version); let mut lock_errors: Vec<String> = vec![]; - let composer = self.create_composer_instance(input, io, None, false, None)?; + let composer = self.create_composer_instance(input, io_box.clone(), None, false, None)?; let mut composer = crate::command::composer_full_mut(&composer); let check_lock = (check_lock && composer |
