Skip to content

Commit

Permalink
Refact: if ~~> match
Browse files Browse the repository at this point in the history
Feels like a cleaner expression of the code branching and balance of
branches.
  • Loading branch information
dream-dasher committed Aug 13, 2024
1 parent 1023e8b commit c085a8e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ fn check_for_common_syntax_error(rep_arg: &str) -> Result<()> {
/// Build a WalkDir object with depth limits based information passed in
#[tracing::instrument]
fn walkdir_build_with_depths(does_recurse: bool) -> WalkDir {
if does_recurse {
tracing::debug!("Recursable WalkDir");
return WalkDir::new(".").contents_first(true).min_depth(1);
match does_recurse {
true => {
tracing::debug!("Recursable WalkDir");
WalkDir::new(".").contents_first(true).min_depth(1)
}
false => {
tracing::debug!("non-recursing (shallow) WalkDir");
WalkDir::new(".").contents_first(true).min_depth(1).max_depth(1)
}
}

tracing::debug!("non-recursing (shallow) WalkDir");
WalkDir::new(".").contents_first(true).min_depth(1).max_depth(1)
}

/// /////////////////////////////////////////////////////////////////////////////////////// //
Expand Down

0 comments on commit c085a8e

Please sign in to comment.