Skip to content

Commit 8c0ad61

Browse files
committed
Fix the build of timezone.rs on recent Rust versions.
1 parent 7bfdde2 commit 8c0ad61

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cap-time-ext/src/timezone.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@ use iana_time_zone::get_timezone;
44
/// A reference to a timezone resource.
55
pub struct Timezone(());
66

7+
/// An error type returned by `Timezone::timezone_name`.
78
#[derive(Debug)]
89
pub struct TimezoneError(String);
910

11+
impl std::error::Error for TimezoneError {}
12+
13+
impl std::fmt::Display for TimezoneError {
14+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15+
self.0.fmt(f)
16+
}
17+
}
18+
1019
impl Timezone {
1120
/// Constructs a new instance of `Self`.
1221
///

0 commit comments

Comments
 (0)