diff --git a/src/main.rs b/src/main.rs index a5d20c6..4b43cbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ extern crate clap; extern crate libc; extern crate notify; -mod filter; +mod notification_filter; use std::ffi::CString; use std::sync::mpsc::{channel, Receiver, RecvError}; @@ -13,7 +13,7 @@ use clap::{App, Arg}; use libc::system; use notify::{Event, RecommendedWatcher, Watcher}; -use filter::Filter; +use notification_filter::NotificationFilter; fn clear() { // TODO: determine better way to do this @@ -36,7 +36,7 @@ fn invoke(cmd: &str) { } } -fn wait(rx: &Receiver, filter: &Filter, verbose: bool) -> Result { +fn wait(rx: &Receiver, filter: &NotificationFilter, verbose: bool) -> Result { loop { // Block on initial notification let e = try!(rx.recv()); @@ -114,7 +114,7 @@ fn main() { let verbose = args.is_present("verbose"); let cwd = env::current_dir().unwrap(); - let mut filter = Filter::new(&cwd); + let mut filter = NotificationFilter::new(&cwd); // Ignore python bytecode and dotted directories by default let default_filters = vec!["*.pyc", ".*/*"]; diff --git a/src/filter.rs b/src/notification_filter.rs similarity index 93% rename from src/filter.rs rename to src/notification_filter.rs index 998c2c0..4c5053d 100644 --- a/src/filter.rs +++ b/src/notification_filter.rs @@ -4,15 +4,15 @@ use std::path::{Path,PathBuf}; use self::glob::{Pattern,PatternError}; -pub struct Filter { +pub struct NotificationFilter { cwd: PathBuf, filters: Vec, ignores: Vec } -impl Filter { - pub fn new(current_dir: &Path) -> Filter { - Filter { +impl NotificationFilter { + pub fn new(current_dir: &Path) -> NotificationFilter { + NotificationFilter { cwd: current_dir.to_path_buf(), filters: vec![], ignores: vec![]