@@ -46,7 +46,7 @@ async fn get_narinfo(
4646 }
4747
4848 let store_path_hash = components[ 0 ] . to_string ( ) ;
49- let key = format ! ( "{}.narinfo" , store_path_hash ) ;
49+ let key = format ! ( "{store_path_hash }.narinfo" ) ;
5050
5151 if state
5252 . narinfo_negative_cache
@@ -92,14 +92,12 @@ async fn put_narinfo(
9292 let gha_cache = state. gha_cache . as_ref ( ) . ok_or ( Error :: GHADisabled ) ?;
9393
9494 let store_path_hash = components[ 0 ] . to_string ( ) ;
95- let key = format ! ( "{}.narinfo" , store_path_hash ) ;
95+ let key = format ! ( "{store_path_hash }.narinfo" ) ;
9696 let allocation = gha_cache. api . allocate_file_with_random_suffix ( & key) . await ?;
9797
9898 let body_stream = body. into_data_stream ( ) ;
99- let stream = StreamReader :: new (
100- body_stream
101- . map ( |r| r. map_err ( |e| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , e. to_string ( ) ) ) ) ,
102- ) ;
99+ let stream =
100+ StreamReader :: new ( body_stream. map ( |r| r. map_err ( |e| std:: io:: Error :: other ( e. to_string ( ) ) ) ) ) ;
103101
104102 gha_cache. api . upload_file ( allocation, stream) . await ?;
105103 state. metrics . narinfos_uploaded . incr ( ) ;
@@ -128,7 +126,7 @@ async fn get_nar(Extension(state): Extension<State>, Path(path): Path<String>) -
128126
129127 if let Some ( upstream) = & state. upstream {
130128 state. metrics . nars_sent_upstream . incr ( ) ;
131- Ok ( Redirect :: temporary ( & format ! ( "{}/nar/{}" , upstream , path ) ) )
129+ Ok ( Redirect :: temporary ( & format ! ( "{upstream }/nar/{path}" ) ) )
132130 } else {
133131 Err ( Error :: NotFound )
134132 }
@@ -147,10 +145,8 @@ async fn put_nar(
147145 . await ?;
148146
149147 let body_stream = body. into_data_stream ( ) ;
150- let stream = StreamReader :: new (
151- body_stream
152- . map ( |r| r. map_err ( |e| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , e. to_string ( ) ) ) ) ,
153- ) ;
148+ let stream =
149+ StreamReader :: new ( body_stream. map ( |r| r. map_err ( |e| std:: io:: Error :: other ( e. to_string ( ) ) ) ) ) ;
154150
155151 gha_cache. api . upload_file ( allocation, stream) . await ?;
156152 state. metrics . nars_uploaded . incr ( ) ;
@@ -160,7 +156,7 @@ async fn put_nar(
160156
161157fn pull_through ( state : & State , path : & str ) -> Result < Redirect > {
162158 if let Some ( upstream) = & state. upstream {
163- Ok ( Redirect :: temporary ( & format ! ( "{}/{}" , upstream , path ) ) )
159+ Ok ( Redirect :: temporary ( & format ! ( "{upstream }/{path}" ) ) )
164160 } else {
165161 Err ( Error :: NotFound )
166162 }
0 commit comments