Remove ErrorString
This commit is contained in:
parent
eef5082c93
commit
0a48078345
|
@ -1,4 +1,4 @@
|
|||
pub use tool_helper::{Error, ErrorString};
|
||||
pub use tool_helper::Error;
|
||||
|
||||
pub mod config_reader;
|
||||
pub mod encoder;
|
||||
|
|
|
@ -21,10 +21,6 @@ macro_rules! format_if_error {
|
|||
};
|
||||
}
|
||||
|
||||
pub trait ErrorString {
|
||||
fn to_string(self) -> String;
|
||||
}
|
||||
|
||||
pub struct Error {
|
||||
pub exit_code: i32,
|
||||
pub action: String,
|
||||
|
@ -109,12 +105,6 @@ impl std::convert::From<std::convert::Infallible> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: ErrorString> std::convert::From<T> for Error {
|
||||
fn from(error: T) -> Self {
|
||||
Error::from_text(error.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn prefix_if_error<T>(prefix: &str, result: Result<T, Error>) -> Result<T, Error> {
|
||||
match result {
|
||||
Ok(value) => Ok(value),
|
||||
|
|
Loading…
Reference in New Issue