diff options
Diffstat (limited to 'crates/shirabe/src/command/show_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/show_command.rs | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/crates/shirabe/src/command/show_command.rs b/crates/shirabe/src/command/show_command.rs index aa63d8e7..6c693e62 100644 --- a/crates/shirabe/src/command/show_command.rs +++ b/crates/shirabe/src/command/show_command.rs @@ -359,14 +359,11 @@ impl ShowCommand { if let Some(ref mp) = matched_package && mp.as_complete().is_none() { - return Err(LogicException { - message: format!( - "ShowCommand::getPackage can only work with CompletePackageInterface, but got {}", - shirabe_php_shim::get_class(&PhpMixed::Null) - ), - code: 0, - } - .into()); + return Err(LogicException::new(format!( + "ShowCommand::getPackage can only work with CompletePackageInterface, but got {}", + shirabe_php_shim::get_class(&PhpMixed::Null) + )) + .into()); } let matched_package = matched_package.and_then(|mp| mp.as_complete()); @@ -1817,10 +1814,9 @@ impl Command for ShowCommand { .as_string() .is_some() { - return Err(InvalidArgumentException { - message: "You cannot use --self together with a package name".to_string(), - code: 0, - } + return Err(InvalidArgumentException::new( + "You cannot use --self together with a package name".to_string(), + ) .into()); } installed_repo = RepositoryInterfaceHandle::new(InstalledRepository::new(vec