2
2
3
3
pub use crate :: backend:: fs:: inotify:: { CreateFlags , WatchFlags } ;
4
4
use crate :: backend:: fs:: syscalls;
5
- use crate :: fd:: { BorrowedFd , OwnedFd } ;
5
+ use crate :: fd:: { AsFd , OwnedFd } ;
6
6
use crate :: io;
7
7
8
8
/// `inotify_init1(flags)`—Creates a new inotify object.
@@ -25,11 +25,11 @@ pub fn inotify_init(flags: CreateFlags) -> io::Result<OwnedFd> {
25
25
/// application should keep track of this externally to avoid logic errors.
26
26
#[ inline]
27
27
pub fn inotify_add_watch < P : crate :: path:: Arg > (
28
- inot : BorrowedFd < ' _ > ,
28
+ inot : impl AsFd ,
29
29
path : P ,
30
30
flags : WatchFlags ,
31
31
) -> io:: Result < i32 > {
32
- path. into_with_c_str ( |path| syscalls:: inotify_add_watch ( inot, path, flags) )
32
+ path. into_with_c_str ( |path| syscalls:: inotify_add_watch ( inot. as_fd ( ) , path, flags) )
33
33
}
34
34
35
35
/// `inotify_rm_watch(self, wd)`—Removes a watch from this inotify.
@@ -38,6 +38,6 @@ pub fn inotify_add_watch<P: crate::path::Arg>(
38
38
/// [`inotify_add_watch`] and not previously have been removed.
39
39
#[ doc( alias = "inotify_rm_watch" ) ]
40
40
#[ inline]
41
- pub fn inotify_remove_watch ( inot : BorrowedFd < ' _ > , wd : i32 ) -> io:: Result < ( ) > {
42
- syscalls:: inotify_rm_watch ( inot, wd)
41
+ pub fn inotify_remove_watch ( inot : impl AsFd , wd : i32 ) -> io:: Result < ( ) > {
42
+ syscalls:: inotify_rm_watch ( inot. as_fd ( ) , wd)
43
43
}
0 commit comments