Remove InternalError, replaced by unreachable! macro

This commit is contained in:
João M. Bezerra 2021-11-02 06:17:41 -03:00
parent fadc412896
commit 047102ec07
2 changed files with 1 additions and 10 deletions

View File

@ -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)),
};

View File

@ -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")