chore: cargo fmt
This commit is contained in:
@ -12,7 +12,7 @@ impl Errno {
|
||||
Self { raw_errno: errno }
|
||||
}
|
||||
pub fn errno() -> Self {
|
||||
Self::new(unsafe { *libc::__errno_location() } )
|
||||
Self::new(unsafe { *libc::__errno_location() })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,8 @@ impl Fanotify {
|
||||
// (long)(meta) ->event_len >= (long)FAN_FAN_EVENT_METADATA_LEN && // struct contains valid size (not implemented)
|
||||
// (long)(meta) ->event_len <= (long)(len) // struct does not read over buffer boundary (not implemented)
|
||||
while offset + EVENT_SIZE <= nread {
|
||||
let mut uninited: MaybeUninit<libc::fanotify_event_metadata> = MaybeUninit::uninit();
|
||||
let mut uninited: MaybeUninit<libc::fanotify_event_metadata> =
|
||||
MaybeUninit::uninit();
|
||||
std::ptr::copy(
|
||||
buffer.as_ptr().add(offset),
|
||||
uninited.as_mut_ptr().cast(),
|
||||
@ -108,7 +109,7 @@ impl Fanotify {
|
||||
// meta = FAN_EVENT_NEXT(meta, len) translate to:
|
||||
// len -= meta->event_len; // shrink rest length
|
||||
// , // comma operator, evaluate first express, but not using its result
|
||||
//
|
||||
//
|
||||
// meta = (struct fanotify_event_metadata*) ( // cast pointer back to metadata type
|
||||
// ((char*)(meta)) // discard metadata type to increase pointer by 1
|
||||
// + (meta) -> event_len // add event_len to move to next
|
||||
|
@ -1,10 +1,10 @@
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
|
||||
pub mod consts;
|
||||
pub mod error;
|
||||
pub mod fanotify;
|
||||
pub mod consts;
|
||||
|
||||
pub use bitflags;
|
||||
|
||||
pub use fanotify::{Fanotify, Error, Response, Response as FanotifyResponse, Event};
|
||||
pub use fanotify::{Error, Event, Fanotify, Response, Response as FanotifyResponse};
|
||||
|
@ -37,7 +37,7 @@ macro_rules! fa_bitflags {
|
||||
}
|
||||
};
|
||||
|
||||
// from nix: input: accept a list of pub struct
|
||||
// from nix: input: accept a list of pub struct
|
||||
(
|
||||
// first
|
||||
$(#[$outer:meta])*
|
||||
@ -72,4 +72,4 @@ macro_rules! fa_bitflags {
|
||||
|
||||
// modified part: empty block don't produce anything.
|
||||
() => {}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user