@@ -207,7 +207,6 @@ impl ToDocumentedType for ListInput {
207
207
}
208
208
}
209
209
210
- #[ allow( clippy:: result_unwrap_used) ]
211
210
#[ cfg( test) ]
212
211
mod test {
213
212
use std:: convert:: TryFrom ;
@@ -223,20 +222,22 @@ mod test {
223
222
224
223
#[ tokio:: test]
225
224
async fn list ( ) {
226
- let tmp_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
225
+ let tmp_dir = tempfile:: tempdir ( ) . expect ( "tmp dir creation failed" ) ;
227
226
let registry = {
228
227
let ( client, _) = radicle_registry_client:: Client :: new_emulator ( ) ;
229
228
registry:: Registry :: new ( client)
230
229
} ;
231
- let store = kv:: Store :: new ( kv:: Config :: new ( tmp_dir. path ( ) . join ( "store" ) ) ) . unwrap ( ) ;
230
+ let store = kv:: Store :: new ( kv:: Config :: new ( tmp_dir. path ( ) . join ( "store" ) ) )
231
+ . expect ( "Store creation failed" ) ;
232
232
let cache = registry:: Cacher :: new ( registry, & store) ;
233
233
let now = registry:: Timestamp :: now ( ) ;
234
234
235
235
let tx = registry:: Transaction {
236
236
id : registry:: Hash ( radicle_registry_client:: TxHash :: random ( ) ) ,
237
237
messages : vec ! [ registry:: Message :: ProjectRegistration {
238
- project_name: registry:: ProjectName :: try_from( "upstream" ) . unwrap( ) ,
239
- org_id: registry:: Id :: try_from( "radicle" ) . unwrap( ) ,
238
+ project_name: registry:: ProjectName :: try_from( "upstream" )
239
+ . expect( "String conversion failed" ) ,
240
+ org_id: registry:: Id :: try_from( "radicle" ) . expect( "String conversion failed" ) ,
240
241
} ] ,
241
242
state : registry:: State :: Confirmed {
242
243
block : 1 ,
@@ -247,9 +248,13 @@ mod test {
247
248
timestamp : now,
248
249
} ;
249
250
250
- cache. cache_transaction ( tx. clone ( ) ) . unwrap ( ) ;
251
+ cache
252
+ . cache_transaction ( tx. clone ( ) )
253
+ . expect ( "Caching transaction failed" ) ;
251
254
252
- let transactions = cache. list_transactions ( vec ! [ ] ) . unwrap ( ) ;
255
+ let transactions = cache
256
+ . list_transactions ( vec ! [ ] )
257
+ . expect ( "Listing transactions failed" ) ;
253
258
254
259
let api = super :: filters ( Arc :: new ( RwLock :: new ( cache) ) ) ;
255
260
let res = request ( )
@@ -259,7 +264,7 @@ mod test {
259
264
. reply ( & api)
260
265
. await ;
261
266
262
- let have: Value = serde_json:: from_slice ( res. body ( ) ) . unwrap ( ) ;
267
+ let have: Value = serde_json:: from_slice ( res. body ( ) ) . expect ( "Serialization to JSON failed" ) ;
263
268
264
269
assert_eq ! ( res. status( ) , StatusCode :: OK ) ;
265
270
assert_eq ! ( have, json!( transactions) ) ;
0 commit comments