Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from pros-rs/snafu-core-error
Browse files Browse the repository at this point in the history
feat: use snafu error implementations
  • Loading branch information
Gavin-Niederman authored Dec 24, 2023
2 parents a43f1b4 + ac035fc commit 672e5d2
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions pros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spin = "0.9.8"
pros-sys = { version = "0.4", path = "../pros-sys", features = ["xapi"] }
snafu = { version = "0.7.5", default-features = false, features = [
"rust_1_61",
"unstable-core-error",
] }
no_std_io = { version = "0.6.0", features = ["alloc"] }
futures = { version = "0.3.28", default-features = false, features = ["alloc"] }
Expand Down
1 change: 0 additions & 1 deletion pros/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ pub enum PortError {
))]
PortCannotBeConfigured,
}
impl core::error::Error for PortError {}

map_errno!(PortError {
ENXIO => Self::PortOutOfRange,
Expand Down
1 change: 0 additions & 1 deletion pros/src/lcd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ pub enum LcdError {
#[snafu(display("LCD not initialized"))]
NotInitialized,
}
impl core::error::Error for LcdError {}
1 change: 0 additions & 1 deletion pros/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ pub enum LinkError {
#[snafu(display("{source}"), context(false))]
Port { source: PortError },
}
impl core::error::Error for LinkError {}

map_errno! {
LinkError {
Expand Down
1 change: 0 additions & 1 deletion pros/src/motor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ pub enum MotorError {
#[snafu(display("{source}"), context(false))]
Port { source: PortError },
}
impl core::error::Error for MotorError {}

map_errno! {
MotorError {}
Expand Down
1 change: 0 additions & 1 deletion pros/src/sensors/gps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ pub enum GpsError {
#[snafu(display("{source}"), context(false))]
Port { source: PortError },
}
impl core::error::Error for GpsError {}

map_errno! {
GpsError {
Expand Down
1 change: 0 additions & 1 deletion pros/src/sensors/vision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ pub enum VisionError {
#[snafu(display("{source}"), context(false))]
Port { source: PortError },
}
impl core::error::Error for VisionError {}

map_errno! {
VisionError {
Expand Down

0 comments on commit 672e5d2

Please sign in to comment.