Skip to content

Commit

Permalink
Merge pull request #46 from kissen/fix/isexist
Browse files Browse the repository at this point in the history
Fix grammar error in error message
  • Loading branch information
webdesus committed Jun 4, 2022
2 parents 6b90de0 + 302f348 commit 488d8a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub struct TransitProcess {
pub enum TransitState {
/// Standard state.
Normal,
/// Pause state when destination path is exist.
/// Pause state when destination path exists.
Exists,
/// Pause state when current process does not have the permission to access from or to
/// path.
Expand Down
4 changes: 2 additions & 2 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ where
}

if let Some(msg) = to.as_ref().to_str() {
let msg = format!("Path \"{}\" is exist", msg);
let msg = format!("Path \"{}\" exists", msg);
err!(&msg, ErrorKind::AlreadyExists);
}
}
Expand Down Expand Up @@ -171,7 +171,7 @@ where
}

if let Some(msg) = to.as_ref().to_str() {
let msg = format!("Path \"{}\" is exist", msg);
let msg = format!("Path \"{}\" exists", msg);
err!(&msg, ErrorKind::AlreadyExists);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn it_copy_exist_not_overwrite() {
match copy(&path_from, &path_to, &options) {
Err(err) => match err.kind {
ErrorKind::AlreadyExists => {
let wrong_path = format!("Path \"{}\" is exist", exist_path.to_str().unwrap());
let wrong_path = format!("Path \"{}\" exists", exist_path.to_str().unwrap());
assert_eq!(wrong_path, err.to_string());
}
_ => {
Expand Down Expand Up @@ -1949,7 +1949,7 @@ fn it_move_exist_not_overwrite() {
match move_dir(&path_from, &path_to, &options) {
Err(err) => match err.kind {
ErrorKind::AlreadyExists => {
let wrong_path = format!("Path \"{}\" is exist", exist_path.to_str().unwrap());
let wrong_path = format!("Path \"{}\" exists", exist_path.to_str().unwrap());
assert_eq!(wrong_path, err.to_string());
}
_ => {
Expand Down
8 changes: 4 additions & 4 deletions tests/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ fn it_copy_exist_not_overwrite() {
match copy(&test_file, &test_file_out, &options) {
Ok(_) => panic!("should be error"),
Err(err) => {
let file_path = format!("Path \"{}\" is exist", test_file_out.to_str().unwrap());
let file_path = format!("Path \"{}\" exists", test_file_out.to_str().unwrap());
assert_eq!(file_path, err.to_string());
assert!(!files_eq(test_file, test_file_out).unwrap());
()
Expand Down Expand Up @@ -497,7 +497,7 @@ fn it_copy_with_progress_exist_not_overwrite() {
match copy_with_progress(&test_file, &test_file_out, &options, func_test) {
Ok(_) => panic!("should be error"),
Err(err) => {
let file_path = format!("Path \"{}\" is exist", test_file_out.to_str().unwrap());
let file_path = format!("Path \"{}\" exists", test_file_out.to_str().unwrap());

assert_eq!(file_path, err.to_string());
assert!(!files_eq(test_file, test_file_out).unwrap());
Expand Down Expand Up @@ -704,7 +704,7 @@ fn it_move_exist_not_overwrite() {
match move_file(&test_file, &test_file_out, &options) {
Ok(_) => panic!("should be error"),
Err(err) => {
let file_path = format!("Path \"{}\" is exist", test_file_out.to_str().unwrap());
let file_path = format!("Path \"{}\" exists", test_file_out.to_str().unwrap());

assert_eq!(file_path, err.to_string());
assert!(!files_eq(test_file, test_file_out).unwrap());
Expand Down Expand Up @@ -964,7 +964,7 @@ fn it_move_with_progress_exist_not_overwrite() {
match move_file_with_progress(&test_file, &test_file_out, &options, func_test) {
Ok(_) => panic!("should be error"),
Err(err) => {
let file_path = format!("Path \"{}\" is exist", test_file_out.to_str().unwrap());
let file_path = format!("Path \"{}\" exists", test_file_out.to_str().unwrap());

assert_eq!(file_path, err.to_string());
assert!(!files_eq(test_file, test_file_out).unwrap());
Expand Down

0 comments on commit 488d8a7

Please sign in to comment.