We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 967aa5a commit 2e9f3dcCopy full SHA for 2e9f3dc
src/sys/fanotify.rs
@@ -500,17 +500,15 @@ impl Fanotify {
500
501
fn get_struct<T>(&self, buffer: &[u8; 4096], offset: usize) -> T {
502
let struct_size = size_of::<T>();
503
- let struct_obj = unsafe {
+ unsafe {
504
let mut struct_obj = MaybeUninit::<T>::uninit();
505
std::ptr::copy_nonoverlapping(
506
buffer.as_ptr().add(offset),
507
struct_obj.as_mut_ptr().cast(),
508
(4096 - offset).min(struct_size),
509
);
510
struct_obj.assume_init()
511
- };
512
-
513
- struct_obj
+ }
514
}
515
516
/// Read incoming events from the fanotify group.
0 commit comments