diff --git a/crates/portal-wormhole/src/fs/path_parts.rs b/crates/portal-wormhole/src/fs/path_parts.rs index 666fb3c..5b91550 100644 --- a/crates/portal-wormhole/src/fs/path_parts.rs +++ b/crates/portal-wormhole/src/fs/path_parts.rs @@ -53,10 +53,10 @@ mod tests { assert_eq!( expected, PathParts::try_from(Path::new(input)) - .unwrap() + .expect("input to be a valid path") .to_path_with_counter(1) .to_str() - .unwrap() + .expect("path to be valid unicode") ); } } diff --git a/crates/portal-wormhole/src/fs/persist.rs b/crates/portal-wormhole/src/fs/persist.rs index cf6348b..b796d4c 100644 --- a/crates/portal-wormhole/src/fs/persist.rs +++ b/crates/portal-wormhole/src/fs/persist.rs @@ -37,8 +37,8 @@ mod tests { #[test] fn uses_original_file_name_when_possible() { let expected_path = PathBuf::from("bar/foo.txt"); - let path = - open_with_conflict_resolution(&expected_path, open(VecDeque::default())).unwrap(); + let path = open_with_conflict_resolution(&expected_path, open(VecDeque::default())) + .expect("open to succeed"); assert_eq!(path, expected_path); } @@ -52,7 +52,8 @@ mod tests { PathBuf::from("bar/foo (3).txt"), ]; let expected_path = PathBuf::from("bar/foo (4).txt"); - let path = open_with_conflict_resolution(&first_path, open(existing_paths.into())).unwrap(); + let path = open_with_conflict_resolution(&first_path, open(existing_paths.into())) + .expect("open to succeed"); assert_eq!(path, expected_path); }