Skip to content

Commit da9485e

Browse files
authored
s/seconds/duration in variable name to CacheControl (#131)
I found the docs a bit confusing/inconsistent here (https://docs.rs/headers/0.3.8/headers/struct.CacheControl.html#method.with_max_age) since Duration needn't be specified in seconds.
1 parent 92ed9d7 commit da9485e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/common/cache_control.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,26 +159,26 @@ impl CacheControl {
159159
}
160160

161161
/// Set the `max-age` directive.
162-
pub fn with_max_age(mut self, seconds: Duration) -> Self {
163-
self.max_age = Some(seconds.into());
162+
pub fn with_max_age(mut self, duration: Duration) -> Self {
163+
self.max_age = Some(duration.into());
164164
self
165165
}
166166

167167
/// Set the `max-stale` directive.
168-
pub fn with_max_stale(mut self, seconds: Duration) -> Self {
169-
self.max_stale = Some(seconds.into());
168+
pub fn with_max_stale(mut self, duration: Duration) -> Self {
169+
self.max_stale = Some(duration.into());
170170
self
171171
}
172172

173173
/// Set the `min-fresh` directive.
174-
pub fn with_min_fresh(mut self, seconds: Duration) -> Self {
175-
self.min_fresh = Some(seconds.into());
174+
pub fn with_min_fresh(mut self, duration: Duration) -> Self {
175+
self.min_fresh = Some(duration.into());
176176
self
177177
}
178178

179179
/// Set the `s-maxage` directive.
180-
pub fn with_s_max_age(mut self, seconds: Duration) -> Self {
181-
self.s_max_age = Some(seconds.into());
180+
pub fn with_s_max_age(mut self, duration: Duration) -> Self {
181+
self.s_max_age = Some(duration.into());
182182
self
183183
}
184184
}

0 commit comments

Comments
 (0)