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

View File

@ -15,7 +15,7 @@ readme = "README.md"
[dependencies]
chrono = "0.4.9"
clap = "2.33.0"
crossterm = "0.10.2"
crossterm = "0.11.0"
failure = "0.1.5"
futures-preview = "0.3.0-alpha.18"
fern = "0.5"
@ -28,7 +28,9 @@ sysinfo = "0.9.4"
tokio = "0.2.0-alpha.4"
[dependencies.tui-temp-fork]
version = "0.6.2"
#git = "https://github.com/ClementTsang/tui-rs"
#path = "../tui-rs"
version = "0.6.4"
default-features = false
features = ['crossterm']

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() }