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

@@ -10,13 +10,12 @@ description = "A small library of effect types and conversions for ROG Aura"
edition = "2018"
[dependencies]
gumdrop = "^0.8.0"
dbus = { version = "^0.8.2" }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
thiserror = "^1.0.15"
yansi-term = "0.1.2"
gumdrop = "^0.8"
dbus = { version = "^0.8" }
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0"
yansi-term = "^0.1"
[dev-dependencies]
tinybmp = "0.2.3"
tinybmp = "^0.2.3"

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"),
}
}
}