mirror of
https://github.com/ouch-org/ouch.git
synced 2025-07-21 17:10:15 +00:00
Remove InternalError, replaced by unreachable! macro
This commit is contained in:
parent
fadc412896
commit
047102ec07
@ -33,7 +33,7 @@ impl<'a> Confirmation<'a> {
|
||||
pub fn ask(&self, substitute: Option<&'a str>) -> crate::Result<bool> {
|
||||
let message = match (self.placeholder, substitute) {
|
||||
(None, _) => Cow::Borrowed(self.prompt),
|
||||
(Some(_), None) => return Err(crate::Error::InternalError),
|
||||
(Some(_), None) => unreachable!("dev error, should be reported, we checked this won't happen"),
|
||||
(Some(placeholder), Some(subs)) => Cow::Owned(self.prompt.replace(placeholder, subs)),
|
||||
};
|
||||
|
||||
|
@ -35,8 +35,6 @@ pub enum Error {
|
||||
/// TO BE REMOVED
|
||||
UnsupportedZipArchive(&'static str),
|
||||
/// TO BE REMOVED
|
||||
InternalError,
|
||||
/// TO BE REMOVED
|
||||
CompressingRootFolder,
|
||||
/// TO BE REMOVED
|
||||
MissingArgumentsForCompression,
|
||||
@ -151,13 +149,6 @@ impl fmt::Display for Error {
|
||||
.hint("")
|
||||
.hint("Example: `ouch decompress imgs.tar.gz`")
|
||||
}
|
||||
Error::InternalError => {
|
||||
FinalError::with_title("InternalError :(")
|
||||
.detail("This should not have happened")
|
||||
.detail("It's probably our fault")
|
||||
.detail("Please help us improve by reporting the issue at:")
|
||||
.detail(format!(" {}https://github.com/ouch-org/ouch/issues ", *CYAN))
|
||||
}
|
||||
Error::IoError { reason } => FinalError::with_title(reason),
|
||||
Error::CompressionTypo => {
|
||||
FinalError::with_title("Possible typo detected")
|
||||
|
Loading…
x
Reference in New Issue
Block a user