@@ -481,11 +481,11 @@ mod tests {
481481 use tempfile:: TempDir ;
482482
483483 fn setup ( ) -> ( TempDir , ContentStore , MetadataStore ) {
484- let tmp = TempDir :: new ( ) . expect ( "TODO: handle error" ) ;
484+ let tmp = TempDir :: new ( ) . unwrap ( ) ;
485485 let content_store =
486- ContentStore :: new ( tmp. path ( ) . join ( "content" ) , false ) . expect ( "TODO: handle error" ) ;
486+ ContentStore :: new ( tmp. path ( ) . join ( "content" ) , false ) . unwrap ( ) ;
487487 let metadata_store =
488- MetadataStore :: new ( tmp. path ( ) . join ( "metadata.json" ) ) . expect ( "TODO: handle error" ) ;
488+ MetadataStore :: new ( tmp. path ( ) . join ( "metadata.json" ) ) . unwrap ( ) ;
489489 ( tmp, content_store, metadata_store)
490490 }
491491
@@ -495,24 +495,24 @@ mod tests {
495495
496496 // Create a test file
497497 let test_file = tmp. path ( ) . join ( "test.txt" ) ;
498- fs:: write ( & test_file, "hello world" ) . expect ( "TODO: handle error" ) ;
498+ fs:: write ( & test_file, "hello world" ) . unwrap ( ) ;
499499
500500 // Delete it
501501 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
502502 let delete_meta = executor
503503 . execute ( FileOperation :: Delete {
504504 path : test_file. clone ( ) ,
505505 } )
506- . expect ( "TODO: handle error" ) ;
506+ . unwrap ( ) ;
507507
508508 assert ! ( !test_file. exists( ) ) ;
509509
510510 // Undo the delete
511511 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
512- executor. undo ( & delete_meta. id ) . expect ( "TODO: handle error" ) ;
512+ executor. undo ( & delete_meta. id ) . unwrap ( ) ;
513513
514514 assert ! ( test_file. exists( ) ) ;
515- assert_eq ! ( fs:: read_to_string( & test_file) . expect ( "TODO: handle error" ) , "hello world" ) ;
515+ assert_eq ! ( fs:: read_to_string( & test_file) . unwrap ( ) , "hello world" ) ;
516516 }
517517
518518 #[ test]
@@ -521,7 +521,7 @@ mod tests {
521521
522522 // Create a test file
523523 let test_file = tmp. path ( ) . join ( "test.txt" ) ;
524- fs:: write ( & test_file, "original content" ) . expect ( "TODO: handle error" ) ;
524+ fs:: write ( & test_file, "original content" ) . unwrap ( ) ;
525525
526526 // Modify it
527527 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
@@ -530,15 +530,15 @@ mod tests {
530530 path : test_file. clone ( ) ,
531531 new_content : b"modified content" . to_vec ( ) ,
532532 } )
533- . expect ( "TODO: handle error" ) ;
533+ . unwrap ( ) ;
534534
535- assert_eq ! ( fs:: read_to_string( & test_file) . expect ( "TODO: handle error" ) , "modified content" ) ;
535+ assert_eq ! ( fs:: read_to_string( & test_file) . unwrap ( ) , "modified content" ) ;
536536
537537 // Undo the modify
538538 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
539- executor. undo ( & modify_meta. id ) . expect ( "TODO: handle error" ) ;
539+ executor. undo ( & modify_meta. id ) . unwrap ( ) ;
540540
541- assert_eq ! ( fs:: read_to_string( & test_file) . expect ( "TODO: handle error" ) , "original content" ) ;
541+ assert_eq ! ( fs:: read_to_string( & test_file) . unwrap ( ) , "original content" ) ;
542542 }
543543
544544 #[ test]
@@ -548,7 +548,7 @@ mod tests {
548548 // Create a test file
549549 let source = tmp. path ( ) . join ( "source.txt" ) ;
550550 let dest = tmp. path ( ) . join ( "dest.txt" ) ;
551- fs:: write ( & source, "content" ) . expect ( "TODO: handle error" ) ;
551+ fs:: write ( & source, "content" ) . unwrap ( ) ;
552552
553553 // Move it
554554 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
@@ -557,14 +557,14 @@ mod tests {
557557 source : source. clone ( ) ,
558558 destination : dest. clone ( ) ,
559559 } )
560- . expect ( "TODO: handle error" ) ;
560+ . unwrap ( ) ;
561561
562562 assert ! ( !source. exists( ) ) ;
563563 assert ! ( dest. exists( ) ) ;
564564
565565 // Undo the move
566566 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
567- executor. undo ( & move_meta. id ) . expect ( "TODO: handle error" ) ;
567+ executor. undo ( & move_meta. id ) . unwrap ( ) ;
568568
569569 assert ! ( source. exists( ) ) ;
570570 assert ! ( !dest. exists( ) ) ;
@@ -577,7 +577,7 @@ mod tests {
577577 // Create a test file
578578 let source = tmp. path ( ) . join ( "source.txt" ) ;
579579 let dest = tmp. path ( ) . join ( "dest.txt" ) ;
580- fs:: write ( & source, "content" ) . expect ( "TODO: handle error" ) ;
580+ fs:: write ( & source, "content" ) . unwrap ( ) ;
581581
582582 // Copy it
583583 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
@@ -586,14 +586,14 @@ mod tests {
586586 source : source. clone ( ) ,
587587 destination : dest. clone ( ) ,
588588 } )
589- . expect ( "TODO: handle error" ) ;
589+ . unwrap ( ) ;
590590
591591 assert ! ( source. exists( ) ) ;
592592 assert ! ( dest. exists( ) ) ;
593593
594594 // Undo the copy (deletes the copy)
595595 let mut executor = OperationExecutor :: new ( & content_store, & mut metadata_store) ;
596- executor. undo ( & copy_meta. id ) . expect ( "TODO: handle error" ) ;
596+ executor. undo ( & copy_meta. id ) . unwrap ( ) ;
597597
598598 assert ! ( source. exists( ) ) ;
599599 assert ! ( !dest. exists( ) ) ;
0 commit comments