Skip to content

Commit

Permalink
Rename Expires::at to Expires::expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Aug 8, 2020
1 parent d0bf1cb commit 1705dd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cache/expires.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::time::{Duration, SystemTime};
/// let expires = Expires::from_headers(res)?.unwrap();
///
/// // HTTP dates only have second-precision.
/// let elapsed = time.duration_since(expires.at())?;
/// let elapsed = time.duration_since(expires.expiration())?;
/// assert_eq!(elapsed.as_secs(), 0);
/// #
/// # Ok(()) }
Expand All @@ -52,7 +52,7 @@ impl Expires {
}

/// Get the expiration time.
pub fn at(&self) -> SystemTime {
pub fn expiration(&self) -> SystemTime {
self.instant
}

Expand Down Expand Up @@ -114,7 +114,7 @@ mod test {
let expires = Expires::from_headers(headers)?.unwrap();

// HTTP dates only have second-precision
let elapsed = time.duration_since(expires.at())?;
let elapsed = time.duration_since(expires.expiration())?;
assert_eq!(elapsed.as_secs(), 0);
Ok(())
}
Expand Down

0 comments on commit 1705dd5

Please sign in to comment.