@@ -341,39 +341,27 @@ mod tests {
341
341
let artifact_two_id_number = db. connection ( ) . await . artifact_id ( & artifact_two) . await ;
342
342
343
343
// We cannot arbitrarily add random sizes to the artifact size
344
- // table, as their is a constraint that the artifact must actually
344
+ // table, as there is a constraint that the artifact must actually
345
345
// exist before attaching something to it.
346
346
347
+ let db = db. connection ( ) . await ;
348
+
347
349
// Artifact one inserts
348
- db. connection ( )
349
- . await
350
- . record_artifact_size ( artifact_one_id_number, "llvm.so" , 32 )
350
+ db. record_artifact_size ( artifact_one_id_number, "llvm.so" , 32 )
351
351
. await ;
352
- db. connection ( )
353
- . await
354
- . record_artifact_size ( artifact_one_id_number, "llvm.a" , 64 )
352
+ db. record_artifact_size ( artifact_one_id_number, "llvm.a" , 64 )
355
353
. await ;
356
354
357
355
// Artifact two inserts
358
- db. connection ( )
359
- . await
360
- . record_artifact_size ( artifact_two_id_number, "another-llvm.a" , 128 )
356
+ db. record_artifact_size ( artifact_two_id_number, "another-llvm.a" , 128 )
361
357
. await ;
362
358
363
- let result_one = db
364
- . connection ( )
365
- . await
366
- . get_artifact_size ( artifact_one_id_number)
367
- . await ;
368
- let result_two = db
369
- . connection ( )
370
- . await
371
- . get_artifact_size ( artifact_two_id_number)
372
- . await ;
359
+ let result_one = db. get_artifact_size ( artifact_one_id_number) . await ;
360
+ let result_two = db. get_artifact_size ( artifact_two_id_number) . await ;
373
361
374
362
// artifact one
375
- assert_eq ! ( Some ( 32 as u64 ) , result_one. get( "llvm.so" ) . copied( ) ) ;
376
- assert_eq ! ( Some ( 64 as u64 ) , result_one. get( "llvm.a" ) . copied( ) ) ;
363
+ assert_eq ! ( Some ( 32u64 ) , result_one. get( "llvm.so" ) . copied( ) ) ;
364
+ assert_eq ! ( Some ( 64u64 ) , result_one. get( "llvm.a" ) . copied( ) ) ;
377
365
assert_eq ! ( None , result_one. get( "another-llvm.a" ) . copied( ) ) ;
378
366
379
367
// artifact two
0 commit comments