Skip to content

Commit

Permalink
Use crates.io Walker instead of unstable fs::walk_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed May 17, 2015
1 parent f40b32f commit 0b127a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "notify"
version = "1.2.1"
version = "1.2.3"
authors = [
"Félix Saparelli <[email protected]>",
"Antti Keränen <[email protected]>",
Expand All @@ -22,8 +22,11 @@ keywords = [
]

[dependencies]
time = "*"
bitflags = "*"
libc = "*"
log = "*"
time = "*"
walker = "^1.0.0"

[target.x86_64-unknown-linux-gnu.dependencies.inotify]
version = "^0.1"
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(rustc_private, libc, fs_time, fs_walk, path_ext)]

#[macro_use] extern crate log;
#[macro_use] extern crate bitflags;

Expand Down
8 changes: 5 additions & 3 deletions src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ use std::sync::{Arc, RwLock};
use std::sync::mpsc::Sender;
use std::thread;
use super::{Error, Event, op, Watcher};
use std::fs::{self, PathExt};
use std::fs::PathExt;
use std::path::{Path, PathBuf};
use self::walker::Walker;

extern crate walker;

pub struct PollWatcher {
tx: Sender<Event>,
Expand Down Expand Up @@ -63,9 +66,8 @@ impl PollWatcher {
}
}

// TODO: recurse into the dir
// TODO: more efficient implementation where the dir tree is cached?
match fs::walk_dir(watch) {
match Walker::new(watch) {
Err(e) => {
let _ = tx.send(Event {
path: Some(watch.clone()),
Expand Down

0 comments on commit 0b127a3

Please sign in to comment.