Bump up version of crossterm, fix some bugs.

This commit is contained in:
ClementTsang
2019-09-24 22:15:43 -04:00
parent f96d82ccb7
commit cb9ec2cdca
2 changed files with 15 additions and 2 deletions
+11
View File
@@ -22,6 +22,11 @@ pub enum RustopError {
/// The data provided is the error found.
#[fail(display = "ERROR: Invalid error during data collection due to Heim: {}", message)]
InvalidHeim { message : String },
/// An error when the Crossterm library encounters a problem.
///
/// The data provided is the error found.
#[fail(display = "ERROR: Invalid error due to Crossterm: {}", message)]
CrosstermError { message : String },
}
impl From<std::io::Error> for RustopError {
@@ -36,6 +41,12 @@ impl From<heim::Error> for RustopError {
}
}
impl From<crossterm::ErrorKind> for RustopError {
fn from(err : crossterm::ErrorKind) -> Self {
RustopError::CrosstermError { message : err.to_string() }
}
}
impl From<std::num::ParseIntError> for RustopError {
fn from(err : std::num::ParseIntError) -> Self {
RustopError::InvalidArg { message : err.to_string() }