@@ -42,15 +42,6 @@ spaces:
4242 )
4343}
4444
45- /// Build a Request from a Key.
46- fn request_from_key ( key : & Key ) -> Request {
47- let mut request = Request :: new ( ) ;
48- for ( k, v) in key. entries ( ) {
49- request = request. with ( k, v) ;
50- }
51- request
52- }
53-
5445/// Archive test data and return the key used.
5546fn archive_test_data ( fdb : & Fdb , step : & str ) -> Key {
5647 let grib_data = fs:: read ( fixtures_dir ( ) . join ( "synth11.grib" ) ) . expect ( "failed to read GRIB" ) ;
@@ -139,7 +130,7 @@ async fn test_fdb_concurrent_retrieve() {
139130 let fdb = Arc :: clone ( & fdb) ;
140131
141132 tasks. spawn ( async move {
142- let key = Key :: new ( )
133+ let request = Request :: new ( )
143134 . with ( "class" , "rd" )
144135 . with ( "expver" , "xxxx" )
145136 . with ( "stream" , "oper" )
@@ -150,8 +141,6 @@ async fn test_fdb_concurrent_retrieve() {
150141 . with ( "step" , & i. to_string ( ) )
151142 . with ( "param" , "151130" ) ;
152143
153- let request = request_from_key ( & key) ;
154-
155144 // Retrieve returns a DataReader that owns the data
156145 let mut reader = fdb. retrieve ( & request) . expect ( "retrieve failed" ) ;
157146
@@ -261,7 +250,7 @@ async fn test_fdb_spawn_blocking_pattern() {
261250 // Retrieve using spawn_blocking
262251 let fdb_clone = Arc :: clone ( & fdb) ;
263252 let result = tokio:: task:: spawn_blocking ( move || {
264- let key = Key :: new ( )
253+ let request = Request :: new ( )
265254 . with ( "class" , "rd" )
266255 . with ( "expver" , "xxxx" )
267256 . with ( "stream" , "oper" )
@@ -272,7 +261,6 @@ async fn test_fdb_spawn_blocking_pattern() {
272261 . with ( "step" , "1" )
273262 . with ( "param" , "151130" ) ;
274263
275- let request = request_from_key ( & key) ;
276264 let mut reader = fdb_clone. retrieve ( & request) . expect ( "retrieve failed" ) ;
277265
278266 let mut buf = Vec :: new ( ) ;
0 commit comments