Use notify 2.6.3

This commit is contained in:
Matt Green 2016-09-14 14:19:05 -04:00
parent 5cf5ce73ca
commit 37f0b062a5
2 changed files with 3 additions and 4 deletions

View File

@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Matt Green <mattgreenrocks@gmail.com>"]
[dependencies]
notify = { git = "https://github.com/passcod/rsnotify" }
notify = "2.6.3"
libc = "0.2.16"

View File

@ -3,7 +3,6 @@ extern crate libc;
use libc::system;
use notify::{RecommendedWatcher, Watcher};
use notify::RecursiveMode;
use std::ffi::CString;
use std::string::String;
use std::sync::mpsc::channel;
@ -21,12 +20,12 @@ fn main() {
let (tx, rx) = channel();
let mut watcher: RecommendedWatcher = Watcher::new(tx)
.expect("unable to create watcher");
watcher.watch(".", RecursiveMode::Recursive)
watcher.watch(".")
.expect("unable to start watching directory");
loop {
match rx.recv() {
Ok(notify::Event{ path: Some(path), op:Ok(op), cookie:_ }) => {
Ok(notify::Event{ path: Some(path), op:Ok(op) }) => {
println!("{:?} {:?}", op, path);
invoke(&cmd);
},