Skip to content

Commit 005e478

Browse files
committed
feat(errors): Use Error trait from core crate
1 parent 62f9bcb commit 005e478

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/errors.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use core::fmt::{self, Display, Formatter};
21
#[cfg(any(feature = "byte", feature = "bit"))]
32
pub use core::num::TryFromIntError;
4-
#[cfg(feature = "std")]
5-
use std::error::Error;
3+
use core::{
4+
error::Error,
5+
fmt::{self, Display, Formatter},
6+
};
67

78
#[cfg(any(feature = "byte", feature = "bit"))]
89
use rust_decimal::Decimal;
@@ -21,7 +22,6 @@ impl Display for ExceededBoundsError {
2122
}
2223

2324
#[cfg(any(feature = "byte", feature = "bit"))]
24-
#[cfg(feature = "std")]
2525
impl Error for ExceededBoundsError {}
2626

2727
#[cfg(any(feature = "byte", feature = "bit"))]
@@ -50,7 +50,6 @@ impl Display for ValueParseError {
5050
}
5151

5252
#[cfg(any(feature = "byte", feature = "bit"))]
53-
#[cfg(feature = "std")]
5453
impl Error for ValueParseError {}
5554

5655
/// The error type returned when parsing units.
@@ -111,7 +110,6 @@ impl Display for UnitParseError {
111110
}
112111
}
113112

114-
#[cfg(feature = "std")]
115113
impl Error for UnitParseError {}
116114

117115
#[cfg(any(feature = "byte", feature = "bit"))]
@@ -150,5 +148,4 @@ impl Display for ParseError {
150148
}
151149

152150
#[cfg(any(feature = "byte", feature = "bit"))]
153-
#[cfg(feature = "std")]
154151
impl Error for ParseError {}

0 commit comments

Comments
 (0)