Skip to content

Commit

Permalink
mv: minor changes and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixhead authored and sylvestre committed Sep 25, 2024
1 parent 0670566 commit 2b7448e
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 305 deletions.
15 changes: 7 additions & 8 deletions src/uu/mv/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum MvError {
TargetNotADirectory(String),
FailedToAccessNotADirectory(String),
FsXError(FsXError),

Check warning on line 24 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L24

Added line #L24 was not covered by tests
NotAllFilesMoved
NotAllFilesMoved,
}

impl Error for MvError {}
Expand Down Expand Up @@ -52,20 +52,19 @@ impl Display for MvError {

Self::FailedToAccessNotADirectory(t) => {
write!(f, "failed to access {t}: Not a directory")
},
Self::FsXError(err)=>{
}
Self::FsXError(err) => {
write!(f, "{err}")

Check warning on line 57 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L56-L57

Added lines #L56 - L57 were not covered by tests
},
}
Self::NotAllFilesMoved => {
write!(f, "failed to move all files")

Check warning on line 60 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L60

Added line #L60 was not covered by tests
},

}
}
}
}

impl From<FsXError> for MvError{
impl From<FsXError> for MvError {
fn from(err: FsXError) -> Self {
MvError::FsXError(err)
Self::FsXError(err)
}

Check warning on line 69 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L67-L69

Added lines #L67 - L69 were not covered by tests
}
Loading

0 comments on commit 2b7448e

Please sign in to comment.