Skip to content

Commit 0b32182

Browse files
committed
Fixed warnings from rust-lang/rfcs#1445.
1 parent bb50154 commit 0b32182

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/format/parsed.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,14 @@ impl Parsed {
470470

471471
Ok(datetime)
472472
} else if let Some(timestamp) = self.timestamp {
473+
use super::ParseError as PE;
474+
use super::ParseErrorKind::{OutOfRange, Impossible};
475+
473476
// if date and time is problematic already, there is no point proceeding.
474477
// we at least try to give a correct error though.
475478
match (date, time) {
476-
(Err(OUT_OF_RANGE), _) | (_, Err(OUT_OF_RANGE)) => return Err(OUT_OF_RANGE),
477-
(Err(IMPOSSIBLE), _) | (_, Err(IMPOSSIBLE)) => return Err(IMPOSSIBLE),
479+
(Err(PE(OutOfRange)), _) | (_, Err(PE(OutOfRange))) => return Err(OUT_OF_RANGE),
480+
(Err(PE(Impossible)), _) | (_, Err(PE(Impossible))) => return Err(IMPOSSIBLE),
478481
(_, _) => {} // one of them is insufficient
479482
}
480483

0 commit comments

Comments
 (0)