Skip to content

Commit

Permalink
Merge pull request #221 from allan2/main
Browse files Browse the repository at this point in the history
Update all deps
  • Loading branch information
hannobraun authored Sep 17, 2024
2 parents 8b9911a + 765ae5e commit f2cc1ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ stream = ["futures-core", "tokio"]

[dependencies]
bitflags = "2"
futures-core = { version = "0.3.1", optional = true }
inotify-sys = "0.1.3"
futures-core = { version = "0.3.30", optional = true }
inotify-sys = "0.1.5"
libc = "0.2"
tokio = { version = "1.0.1", optional = true, features = ["net"] }
tokio = { version = "1.40.0", optional = true, features = ["net"] }

[dev-dependencies]
maplit = "1.0"
rand = "0.8"
tempfile = "3.1.0"
futures-util = "0.3.1"
tokio = { version = "1.0.1", features = ["macros", "rt-multi-thread"] }
tempfile = "3.12.0"
futures-util = "0.3.30"
tokio = { version = "1.40.0", features = ["macros", "rt-multi-thread"] }

[[example]]
name = "stream"
Expand Down
17 changes: 4 additions & 13 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
use std::{
io,
mem,
os::unix::io::RawFd,
path::Path,
};
use std::{io, mem, os::unix::io::RawFd, path::Path};

use inotify_sys as ffi;
use libc::{
c_void,
size_t,
};
use libc::{c_void, size_t};

const INOTIFY_EVENT_SIZE: usize = mem::size_of::<ffi::inotify_event>() + 257;

Expand All @@ -18,7 +10,7 @@ pub fn read_into_buffer(fd: RawFd, buffer: &mut [u8]) -> isize {
ffi::read(
fd,
buffer.as_mut_ptr() as *mut c_void,
buffer.len() as size_t
buffer.len() as size_t,
)
}
}
Expand All @@ -35,8 +27,7 @@ pub fn read_into_buffer(fd: RawFd, buffer: &mut [u8]) -> isize {
/// `ABSOLUTE_PARENT_PATH_LEN + 1 + 255`
///
/// - `ABSOLUTE_PARENT_PATH_LEN` will be calculated at runtime.
/// - Add 1 to account for a `/`, either in between the parent path and a filename
/// or for the root directory.
/// - Add 1 to account for a `/`, either in between the parent path and a filename or for the root directory.
/// - Add the maximum number of chars in a filename, 255.
///
/// See: <https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h>
Expand Down

0 comments on commit f2cc1ab

Please sign in to comment.