1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

ln: rename error variant

from TargetIsDirectory to TargetIsNotADirectory
This commit is contained in:
Daniel Hofstetter 2025-05-30 16:44:00 +02:00
parent 1baedc417b
commit d96b62c17f

View file

@ -48,7 +48,7 @@ pub enum OverwriteMode {
#[derive(Error, Debug)]
enum LnError {
#[error("target {} is not a directory", _0.quote())]
TargetIsDirectory(PathBuf),
TargetIsNotADirectory(PathBuf),
#[error("")]
SomeLinksFailed,
@ -283,7 +283,7 @@ fn exec(files: &[PathBuf], settings: &Settings) -> UResult<()> {
#[allow(clippy::cognitive_complexity)]
fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings) -> UResult<()> {
if !target_dir.is_dir() {
return Err(LnError::TargetIsDirectory(target_dir.to_owned()).into());
return Err(LnError::TargetIsNotADirectory(target_dir.to_owned()).into());
}
// remember the linked destinations for further usage
let mut linked_destinations: HashSet<PathBuf> = HashSet::with_capacity(files.len());