Skip to content

Commit 7040b1e

Browse files
committed
Fixed clippy warning
1 parent a9e5390 commit 7040b1e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sys/fanotify.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -500,17 +500,15 @@ impl Fanotify {
500500

501501
fn get_struct<T>(&self, buffer: &[u8; 4096], offset: usize) -> T {
502502
let struct_size = size_of::<T>();
503-
let struct_obj = unsafe {
503+
unsafe {
504504
let mut struct_obj = MaybeUninit::<T>::uninit();
505505
std::ptr::copy_nonoverlapping(
506506
buffer.as_ptr().add(offset),
507507
struct_obj.as_mut_ptr().cast(),
508508
(4096 - offset).min(struct_size),
509509
);
510510
struct_obj.assume_init()
511-
};
512-
513-
struct_obj
511+
}
514512
}
515513

516514
/// Read incoming events from the fanotify group.

0 commit comments

Comments
 (0)