diff options
Diffstat (limited to 'src/time.rs')
-rw-r--r-- | src/time.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/time.rs b/src/time.rs index dce3ecc..98256b1 100644 --- a/src/time.rs +++ b/src/time.rs @@ -1,4 +1,4 @@ -use crate::error::SiteError; +use crate::error::RikiError; use log::trace; use std::time::{Duration, SystemTime}; use time::{ @@ -9,7 +9,7 @@ use time::{ OffsetDateTime, PrimitiveDateTime, }; -pub fn parse_timestamp(timestamp: &str) -> Result<SystemTime, SiteError> { +pub fn parse_timestamp(timestamp: &str) -> Result<SystemTime, RikiError> { trace!("parsing timestamp {:?}", timestamp); let odt = parse(timestamp)?; let unix = odt.unix_timestamp(); @@ -24,7 +24,7 @@ fn system_time(unix: i64) -> SystemTime { SystemTime::UNIX_EPOCH.checked_add(offset).unwrap() } -fn parse(timestamp: &str) -> Result<OffsetDateTime, SiteError> { +fn parse(timestamp: &str) -> Result<OffsetDateTime, RikiError> { const SIMPLIFIED_ISO9601: &[FormatItem<'static>] = format_description!("[year]-[month]-[day] [hour]:[minute]:[second]"); const SIMPLIFIED_ISO9601_MIN: &[FormatItem<'static>] = @@ -51,7 +51,7 @@ fn parse(timestamp: &str) -> Result<OffsetDateTime, SiteError> { } else if let Ok(t) = parse_one_time_format(timestamp, "RFC2822", &Rfc2822) { Ok(t) } else { - Err(SiteError::UnknownTimestamp(timestamp.into())) + Err(RikiError::UnknownTimestamp(timestamp.into())) } } |