@@ -418,8 +418,7 @@ pub fn main() -> Result<(), Error> {
418
418
log:: info!( "Parsed {} samples in input list" , input_files. len( ) ) ;
419
419
420
420
//check if any of the new files are already existant in the db
421
- let db_metadata: MultiSketch = MultiSketch :: load ( db)
422
- . expect ( & format ! ( "Could not read sketch metadata from .skm: {}" , db) ) ;
421
+ let db_metadata: MultiSketch = MultiSketch :: load ( db) ?;
423
422
424
423
if !db_metadata. append_compatibility ( & input_files) {
425
424
panic ! ( "Databases are not compatible for merging." )
@@ -472,15 +471,13 @@ pub fn main() -> Result<(), Error> {
472
471
. open ( format ! ( "{}.skd" , output) ) ?;
473
472
// stream sketch data directly to concat output file
474
473
let mut db_sketch = File :: open ( format ! ( "{}.skd" , db) ) ?;
475
- println ! ( "{:?}" , db_sketch) ;
476
- println ! ( "{:?}" , output_file) ;
477
474
copy ( & mut db_sketch, & mut output_file) ?;
478
475
479
476
// merge and update skm from db1 and the new just sketched sketch
480
477
let concat_metadata = db2_metadata. merge_sketches ( & db_metadata) ;
481
478
concat_metadata
482
479
. save_metadata ( output)
483
- . expect ( & format ! ( "Could not save metadata to {}" , output) ) ;
480
+ . unwrap_or_else ( |_| panic ! ( "Could not save metadata to {}" , output) ) ;
484
481
Ok ( ( ) )
485
482
}
486
483
0 commit comments