Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegrosjean committed Feb 26, 2020
1 parent 3b90d8e commit ff8f491
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion benches/walk_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn walk_benches(c: &mut Criterion) {

c.bench_function("jwalk (sorted, metadata, n threads)", |b| {
b.iter(|| {
for _ in WalkDirGeneric::<((), (Option<Result<Metadata, Error>>))>::new(linux_dir())
for _ in WalkDirGeneric::<((), Option<Result<Metadata, Error>>)>::new(linux_dir())
.sort(true)
.process_read_dir(|_, dir_entry_results| {
dir_entry_results.iter_mut().for_each(|dir_entry_result| {
Expand Down
9 changes: 2 additions & 7 deletions src/core/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ enum ErrorInner {
path: Option<PathBuf>,
err: io::Error,
},
#[allow(dead_code)]
Loop {
ancestor: PathBuf,
child: PathBuf,
Expand Down Expand Up @@ -199,6 +200,7 @@ impl Error {
}
}

#[allow(dead_code)]
pub(crate) fn from_loop(depth: usize, ancestor: &Path, child: &Path) -> Self {
Error {
depth: depth,
Expand All @@ -211,13 +213,6 @@ impl Error {
}

impl error::Error for Error {
fn description(&self) -> &str {
match self.inner {
ErrorInner::Io { ref err, .. } => err.description(),
ErrorInner::Loop { .. } => "file system loop found",
}
}

fn cause(&self) -> Option<&dyn error::Error> {
match self.inner {
ErrorInner::Io { ref err, .. } => Some(err),
Expand Down

0 comments on commit ff8f491

Please sign in to comment.