summaryrefslogtreecommitdiffstats
path: root/src/fs/dir_action.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/dir_action.rs')
-rw-r--r--src/fs/dir_action.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/fs/dir_action.rs b/src/fs/dir_action.rs
index d72db88..26e78d3 100644
--- a/src/fs/dir_action.rs
+++ b/src/fs/dir_action.rs
@@ -39,19 +39,19 @@ pub enum DirAction {
impl DirAction {
/// Gets the recurse options, if this dir action has any.
- pub fn recurse_options(&self) -> Option<RecurseOptions> {
- match *self {
- Self::Recurse(o) => Some(o),
- _ => None,
+ pub fn recurse_options(self) -> Option<RecurseOptions> {
+ match self {
+ Self::Recurse(o) => Some(o),
+ _ => None,
}
}
/// Whether to treat directories as regular files or not.
- pub fn treat_dirs_as_files(&self) -> bool {
- match *self {
+ pub fn treat_dirs_as_files(self) -> bool {
+ match self {
Self::AsFile => true,
Self::Recurse(o) => o.tree,
- _ => false,
+ _ => false,
}
}
}
@@ -73,10 +73,10 @@ pub struct RecurseOptions {
impl RecurseOptions {
/// Returns whether a directory of the given depth would be too deep.
- pub fn is_too_deep(&self, depth: usize) -> bool {
+ pub fn is_too_deep(self, depth: usize) -> bool {
match self.max_depth {
- None => false,
- Some(d) => d <= depth
+ None => false,
+ Some(d) => d <= depth
}
}
}