diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/error.rs b/src/error.rs index 803bdee..8a496a8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,10 +2,9 @@ use crate::ber::BerObject; use crate::der::DerObject; +use alloc::fmt; use nom::error::{ErrorKind, FromExternalError, ParseError}; use nom::IResult; -use std::error::Error; -use std::fmt; /// Holds the result of parsing functions /// @@ -97,11 +96,14 @@ impl fmt::Display for BerError { } } -impl Error for BerError {} +#[cfg(feature = "std")] +impl std::error::Error for BerError {} -#[cfg(test)] +#[cfg(all(test, feature = "std"))] mod tests { use super::*; + use std::boxed::Box; + use std::error::Error; #[test] fn test_unwrap_bererror() { |