@@ -87,7 +87,7 @@ impl CacheDirective {
8787
8888 s. to_lowercase ( ) ;
8989 let mut parts = s. split ( '=' ) ;
90- let next = parts. next ( ) . unwrap ( ) . clone ( ) ;
90+ let next = parts. next ( ) . unwrap ( ) ;
9191
9292 let mut get_dur = || -> crate :: Result < Duration > {
9393 let dur = parts. next ( ) . status ( 400 ) ?;
@@ -130,21 +130,21 @@ impl From<CacheDirective> for HeaderValue {
130130 let h = |s : String | unsafe { HeaderValue :: from_bytes_unchecked ( s. into_bytes ( ) ) } ;
131131
132132 match directive {
133- Immutable => h ( format ! ( "immutable" ) ) ,
133+ Immutable => h ( "immutable" . to_string ( ) ) ,
134134 MaxAge ( dur) => h ( format ! ( "max-age={}" , dur. as_secs( ) ) ) ,
135135 MaxStale ( dur) => match dur {
136136 Some ( dur) => h ( format ! ( "max-stale={}" , dur. as_secs( ) ) ) ,
137- None => h ( format ! ( "max-stale" ) ) ,
137+ None => h ( "max-stale" . to_string ( ) ) ,
138138 } ,
139139 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 ( ) ) ,
148148 SMaxAge ( dur) => h ( format ! ( "s-max-age={}" , dur. as_secs( ) ) ) ,
149149 StaleIfError ( dur) => h ( format ! ( "stale-if-error={}" , dur. as_secs( ) ) ) ,
150150 StaleWhileRevalidate ( dur) => h ( format ! ( "stale-while-revalidate={}" , dur. as_secs( ) ) ) ,
0 commit comments