1- use super :: { cache:: CachePolicy , metrics:: request_recorder, routes:: get_static} ;
1+ use super :: {
2+ cache:: CachePolicy , headers:: IfNoneMatch , metrics:: request_recorder, routes:: get_static,
3+ } ;
24use axum:: {
35 Router as AxumRouter ,
46 extract:: { Extension , Request } ,
@@ -8,7 +10,7 @@ use axum::{
810 routing:: get_service,
911} ;
1012use axum_extra:: {
11- headers:: { ETag , HeaderMapExt as _, HeaderValue , IfNoneMatch } ,
13+ headers:: { ETag , HeaderMapExt as _, HeaderValue } ,
1214 typed_header:: TypedHeader ,
1315} ;
1416use http:: { Method , StatusCode , Uri } ;
@@ -137,25 +139,23 @@ pub(crate) fn build_static_router() -> AxumRouter {
137139
138140#[ cfg( test) ]
139141mod tests {
140- use super :: { STYLE_CSS , VENDORED_CSS } ;
142+ use super :: * ;
141143 use crate :: {
142144 test:: { AxumResponseTestExt , AxumRouterTestExt , async_wrapper} ,
143- web:: { cache :: CachePolicy , headers:: compute_etag} ,
145+ web:: headers:: compute_etag,
144146 } ;
145- use axum:: { Router , body:: Body , extract:: Request , response:: Response as AxumResponse } ;
146- use axum_extra:: headers:: { ETag , HeaderMapExt as _, IfNoneMatch } ;
147+ use axum:: { Router , body:: Body } ;
147148 use http:: {
148149 HeaderMap ,
149150 header:: { CONTENT_LENGTH , CONTENT_TYPE , ETAG } ,
150151 } ;
151- use reqwest:: StatusCode ;
152152 use std:: fs;
153153 use test_case:: test_case;
154154 use tower:: ServiceExt as _;
155155
156156 const STATIC_SEARCH_PATHS : & [ & str ] = & [ "static" , "vendor" ] ;
157157
158- fn content_length ( resp : & AxumResponse ) -> u64 {
158+ fn content_length ( resp : & Response ) -> u64 {
159159 resp. headers ( )
160160 . get ( CONTENT_LENGTH )
161161 . expect ( "content-length header" )
@@ -165,7 +165,7 @@ mod tests {
165165 . unwrap ( )
166166 }
167167
168- fn etag ( resp : & AxumResponse ) -> ETag {
168+ fn etag ( resp : & Response ) -> ETag {
169169 let etag = resp. headers ( ) . get ( ETAG ) . unwrap ( ) ;
170170 etag. to_str ( ) . unwrap ( ) . parse ( ) . unwrap ( )
171171 }
0 commit comments