Skip to content

Commit

Permalink
minor refactor and delete main.rs as its not required anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
the-shank committed Jan 23, 2023
1 parent d3c8592 commit d912f96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/bin/broken_symlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,19 @@ fn process_dir(dir: &PathBuf, opts: &Opts) -> Result<()> {
{
let entry =
entry.with_context(|| format!("error processing some file in {}", dir.display()))?;

let file_type = entry.file_type()?;

if file_type.is_dir() {
// process directory
process_dir(&entry.path(), opts)?;
} else if file_type.is_symlink() {
// process symlink
let target = entry.path();
if !target.try_exists().with_context(|| {
format!("Failed to check if symlink exists: {}", target.display())
let path = entry.path();
if !path.try_exists().with_context(|| {
format!("Failed to check if symlink exists: {}", path.display())
})? {
println!("Broken symlink: {}", target.display());
println!("Broken symlink: {}", path.display());
};
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/bin/main.rs

This file was deleted.

0 comments on commit d912f96

Please sign in to comment.