Remove around 14 transitive dependencies

This commit is contained in:
Luke
2020-06-30 20:45:00 +12:00
parent 70a1bc3487
commit 898276494c
7 changed files with 65 additions and 159 deletions

View File

@@ -1,18 +1,20 @@
use std::fmt::Debug;
use thiserror::Error;
use std::fmt;
#[derive(Error, Debug)]
pub enum AuraError {
#[error("unable to parse string to colour")]
ParseColour,
#[error("unable to parse string to speed")]
ParseSpeed,
#[error("unable to parse string to direction")]
ParseDirection,
#[error("unable to parse string to brightness")]
ParseBrightness,
#[error("could not poll the keyboard for input")]
PollKeyboard,
#[error("mode not supported")]
NotSupported,
}
impl fmt::Display for AuraError {
// This trait requires `fmt` with this exact signature.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
AuraError::ParseColour => write!(f, "Could not parse colour"),
AuraError::ParseSpeed => write!(f, "Could not parse speed"),
AuraError::ParseDirection => write!(f, "Could not parse direction"),
AuraError::ParseBrightness => write!(f, "Could not parse brightness"),
}
}
}