We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fbde12 commit 8e4117bCopy full SHA for 8e4117b
src/common/expires.rs
@@ -1,4 +1,4 @@
1
-use std::time::SystemTime;
+use std::{fmt, time::SystemTime};
2
3
use crate::util::HttpDate;
4
@@ -48,3 +48,25 @@ impl From<Expires> for SystemTime {
48
date.0.into()
49
}
50
51
+
52
+impl fmt::Display for Expires {
53
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
54
+ self.0.fmt(f)
55
+ }
56
+}
57
58
+#[cfg(test)]
59
+mod tests {
60
+ use super::super::test_decode;
61
+ use super::*;
62
63
+ fn expires(s: &str) -> Expires {
64
+ test_decode(&[s]).unwrap()
65
66
67
+ #[test]
68
+ fn format() {
69
+ let s = "Thu, 01 Dec 1994 16:00:00 GMT";
70
+ assert_eq!(expires(s).to_string(), s);
71
72
0 commit comments