Skip to content

Commit b68d3b5

Browse files
feat: impl std Error trait for AstrolabeError (#4)
Co-authored-by: Jasmin <code@jasi.dev>
1 parent bb7596a commit b68d3b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/errors/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub(crate) mod invalid_format;
44
pub(crate) mod out_of_range;
55
pub use self::{invalid_format::InvalidFormat, out_of_range::OutOfRange};
6-
use std::fmt;
6+
use std::{error, fmt};
77

88
/// Custom error enum for the astrolabe crate.
99
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -23,6 +23,8 @@ impl fmt::Display for AstrolabeError {
2323
}
2424
}
2525

26+
impl error::Error for AstrolabeError {}
27+
2628
impl From<AstrolabeError> for String {
2729
fn from(e: AstrolabeError) -> Self {
2830
e.to_string()

0 commit comments

Comments
 (0)