File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ signal-hook = "0.3"
41
41
tempfile = " 3.1.0"
42
42
43
43
[target .'cfg(target_os = "linux")' .dev-dependencies ]
44
- inotify = { version = " 0.9 " , default-features = false }
45
- nix = " 0.21 "
44
+ inotify = { version = " 0.10 " , default-features = false }
45
+ nix = " 0.23 "
46
46
timerfd = " 1.1.1"
47
47
48
48
[target .'cfg(windows)' .dev-dependencies ]
Original file line number Diff line number Diff line change @@ -16,14 +16,6 @@ fn main() -> std::io::Result<()> {
16
16
use futures_lite:: future;
17
17
use timerfd:: { SetTimeFlags , TimerFd , TimerState } ;
18
18
19
- /// Converts a [`nix::Error`] into [`std::io::Error`].
20
- fn io_err ( err : nix:: Error ) -> io:: Error {
21
- match err {
22
- nix:: Error :: Sys ( code) => code. into ( ) ,
23
- err => io:: Error :: new ( io:: ErrorKind :: Other , Box :: new ( err) ) ,
24
- }
25
- }
26
-
27
19
/// Sleeps using an OS timer.
28
20
async fn sleep ( dur : Duration ) -> io:: Result < ( ) > {
29
21
// Create an OS timer.
@@ -32,7 +24,7 @@ fn main() -> std::io::Result<()> {
32
24
33
25
// When the OS timer fires, a 64-bit integer can be read from it.
34
26
Async :: new ( timer) ?
35
- . read_with ( |t| nix:: unistd:: read ( t. as_raw_fd ( ) , & mut [ 0u8 ; 8 ] ) . map_err ( io_err ) )
27
+ . read_with ( |t| nix:: unistd:: read ( t. as_raw_fd ( ) , & mut [ 0u8 ; 8 ] ) . map_err ( io :: Error :: from ) )
36
28
. await ?;
37
29
Ok ( ( ) )
38
30
}
You can’t perform that action at this time.
0 commit comments