@@ -87,7 +87,7 @@ impl CacheDirective {
87
87
88
88
s. to_lowercase ( ) ;
89
89
let mut parts = s. split ( '=' ) ;
90
- let next = parts. next ( ) . unwrap ( ) . clone ( ) ;
90
+ let next = parts. next ( ) . unwrap ( ) ;
91
91
92
92
let mut get_dur = || -> crate :: Result < Duration > {
93
93
let dur = parts. next ( ) . status ( 400 ) ?;
@@ -130,21 +130,21 @@ impl From<CacheDirective> for HeaderValue {
130
130
let h = |s : String | unsafe { HeaderValue :: from_bytes_unchecked ( s. into_bytes ( ) ) } ;
131
131
132
132
match directive {
133
- Immutable => h ( format ! ( "immutable" ) ) ,
133
+ Immutable => h ( "immutable" . to_string ( ) ) ,
134
134
MaxAge ( dur) => h ( format ! ( "max-age={}" , dur. as_secs( ) ) ) ,
135
135
MaxStale ( dur) => match dur {
136
136
Some ( dur) => h ( format ! ( "max-stale={}" , dur. as_secs( ) ) ) ,
137
- None => h ( format ! ( "max-stale" ) ) ,
137
+ None => h ( "max-stale" . to_string ( ) ) ,
138
138
} ,
139
139
MinFresh ( dur) => h ( format ! ( "min-fresh={}" , dur. as_secs( ) ) ) ,
140
- MustRevalidate => h ( format ! ( "must-revalidate" ) ) ,
141
- NoCache => h ( format ! ( "no-cache" ) ) ,
142
- NoStore => h ( format ! ( "no-store" ) ) ,
143
- NoTransform => h ( format ! ( "no-transform" ) ) ,
144
- OnlyIfCached => h ( format ! ( "only-if-cached" ) ) ,
145
- Private => h ( format ! ( "private" ) ) ,
146
- ProxyRevalidate => h ( format ! ( "proxy-revalidate" ) ) ,
147
- Public => h ( format ! ( "public" ) ) ,
140
+ MustRevalidate => h ( "must-revalidate" . to_string ( ) ) ,
141
+ NoCache => h ( "no-cache" . to_string ( ) ) ,
142
+ NoStore => h ( "no-store" . to_string ( ) ) ,
143
+ NoTransform => h ( "no-transform" . to_string ( ) ) ,
144
+ OnlyIfCached => h ( "only-if-cached" . to_string ( ) ) ,
145
+ Private => h ( "private" . to_string ( ) ) ,
146
+ ProxyRevalidate => h ( "proxy-revalidate" . to_string ( ) ) ,
147
+ Public => h ( "public" . to_string ( ) ) ,
148
148
SMaxAge ( dur) => h ( format ! ( "s-max-age={}" , dur. as_secs( ) ) ) ,
149
149
StaleIfError ( dur) => h ( format ! ( "stale-if-error={}" , dur. as_secs( ) ) ) ,
150
150
StaleWhileRevalidate ( dur) => h ( format ! ( "stale-while-revalidate={}" , dur. as_secs( ) ) ) ,
0 commit comments