Skip to content

Commit

Permalink
thanks clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 13, 2022
1 parent cc0fd74 commit 51e2b0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/core/dir_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ impl<C: ClientState> DirEntry<C> {
follow_link_ancestors: Arc<Vec<Arc<Path>>>,
) -> Result<Self> {
let metadata = if follow_link {
fs::metadata(&path).map_err(|err| Error::from_path(depth, path.to_owned(), err))?
fs::metadata(path).map_err(|err| Error::from_path(depth, path.to_owned(), err))?
} else {
fs::symlink_metadata(&path)
fs::symlink_metadata(path)
.map_err(|err| Error::from_path(depth, path.to_owned(), err))?
};

let root_name = path.file_name().unwrap_or_else(|| path.as_os_str());
let root_name = path.file_name().unwrap_or(path.as_os_str());

let read_children_path: Option<Arc<Path>> = if metadata.file_type().is_dir() {
Some(Arc::from(path))
Expand Down Expand Up @@ -196,16 +196,14 @@ impl<C: ClientState> DirEntry<C> {
&self,
client_read_state: C::ReadDirState,
) -> Option<ReadDirSpec<C>> {
if let Some(read_children_path) = self.read_children_path.as_ref() {
Some(ReadDirSpec {
self.read_children_path
.as_ref()
.map(|read_children_path| ReadDirSpec {
depth: self.depth,
client_read_state,
path: read_children_path.clone(),
follow_link_ancestors: self.follow_link_ancestors.clone(),
})
} else {
None
}
}

pub(crate) fn follow_symlink(&self) -> Result<Self> {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ impl<C: ClientState> IntoIterator for WalkDirGeneric<C> {
root_entry_results,
parallelism,
min_depth,
root_read_dir_state.clone(),
root_read_dir_state,
Arc::new(move |read_dir_spec| {
let ReadDirSpec {
path,
Expand Down Expand Up @@ -487,7 +487,7 @@ impl<C: ClientState> Clone for WalkDirOptions<C> {
impl Parallelism {
pub(crate) fn install<OP>(&self, op: OP)
where
OP: FnOnce() -> () + Send + 'static,
OP: FnOnce() + Send + 'static,
{
match self {
Parallelism::Serial => op(),
Expand Down

0 comments on commit 51e2b0d

Please sign in to comment.