Skip to content

Commit aef2227

Browse files
committed
Completed renaming of AddWatchFlags and InitFlags.
1 parent 4dca32b commit aef2227

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/sys/inotify.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
//!
99
//! Monitor all events happening in directory "test":
1010
//! ```no_run
11-
//! # use nix::sys::inotify::{EventFlags,InotifyInitFlags,Inotify};
11+
//! # use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify};
1212
//! #
1313
//! // We create a new inotify instance.
14-
//! let instance = Inotify::init(InotifyInitFlags::empty()).unwrap();
14+
//! let instance = Inotify::init(InitFlags::empty()).unwrap();
1515
//!
1616
//! // We add a new watch on directory "test" for all events.
17-
//! let wd = instance.add_watch("test", EventFlags::IN_ALL_EVENTS).unwrap();
17+
//! let wd = instance.add_watch("test", AddWatchFlags::IN_ALL_EVENTS).unwrap();
1818
//!
1919
//! loop {
2020
//! // We read from our inotify instance for events.

test/sys/test_inotify.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use nix::sys::inotify::{EventFlags,InotifyInitFlags,Inotify};
1+
use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify};
22
use nix::Error;
33
use nix::errno::Errno;
44
use tempfile;
@@ -7,11 +7,11 @@ use std::fs::{rename, File};
77

88
#[test]
99
pub fn test_inotify() {
10-
let instance = Inotify::init(InotifyInitFlags::IN_NONBLOCK)
10+
let instance = Inotify::init(InitFlags::IN_NONBLOCK)
1111
.unwrap();
1212
let tempdir = tempfile::tempdir().unwrap();
1313

14-
instance.add_watch(tempdir.path(), EventFlags::IN_ALL_EVENTS).unwrap();
14+
instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap();
1515

1616
let events = instance.read_events();
1717
assert_eq!(events.unwrap_err(), Error::Sys(Errno::EAGAIN));
@@ -24,11 +24,11 @@ pub fn test_inotify() {
2424

2525
#[test]
2626
pub fn test_inotify_multi_events() {
27-
let instance = Inotify::init(InotifyInitFlags::IN_NONBLOCK)
27+
let instance = Inotify::init(InitFlags::IN_NONBLOCK)
2828
.unwrap();
2929
let tempdir = tempfile::tempdir().unwrap();
3030

31-
instance.add_watch(tempdir.path(), EventFlags::IN_ALL_EVENTS).unwrap();
31+
instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap();
3232

3333
let events = instance.read_events();
3434
assert_eq!(events.unwrap_err(), Error::Sys(Errno::EAGAIN));
@@ -46,19 +46,19 @@ pub fn test_inotify_multi_events() {
4646
let events = instance.read_events().unwrap();
4747
assert_eq!(events.len(), 5);
4848

49-
assert_eq!(events[0].mask, EventFlags::IN_CREATE);
49+
assert_eq!(events[0].mask, AddWatchFlags::IN_CREATE);
5050
assert_eq!(events[0].name, Some(OsString::from("test")));
5151

52-
assert_eq!(events[1].mask, EventFlags::IN_OPEN);
52+
assert_eq!(events[1].mask, AddWatchFlags::IN_OPEN);
5353
assert_eq!(events[1].name, Some(OsString::from("test")));
5454

55-
assert_eq!(events[2].mask, EventFlags::IN_CLOSE_WRITE);
55+
assert_eq!(events[2].mask, AddWatchFlags::IN_CLOSE_WRITE);
5656
assert_eq!(events[2].name, Some(OsString::from("test")));
5757

58-
assert_eq!(events[3].mask, EventFlags::IN_MOVED_FROM);
58+
assert_eq!(events[3].mask, AddWatchFlags::IN_MOVED_FROM);
5959
assert_eq!(events[3].name, Some(OsString::from("test")));
6060

61-
assert_eq!(events[4].mask, EventFlags::IN_MOVED_TO);
61+
assert_eq!(events[4].mask, AddWatchFlags::IN_MOVED_TO);
6262
assert_eq!(events[4].name, Some(OsString::from("test2")));
6363

6464
assert_eq!(events[3].cookie, events[4].cookie);

0 commit comments

Comments
 (0)