mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fix clippy warning & error
They were introduced as part of Rust v1.92.0.
This commit is contained in:
+1
-1
@@ -85,6 +85,7 @@ fn_to_numeric_cast_any = "forbid"
|
||||
get_unwrap = "forbid"
|
||||
host_endian_bytes = "forbid"
|
||||
if_then_some_else_none = "forbid"
|
||||
implicit_clone = "forbid"
|
||||
indexing_slicing = "deny"
|
||||
infinite_loop = "forbid"
|
||||
integer_division = "forbid"
|
||||
@@ -120,7 +121,6 @@ rest_pat_in_fully_bound_structs = "forbid"
|
||||
str_to_string = "forbid"
|
||||
string_lit_chars_any = "forbid"
|
||||
string_slice = "forbid"
|
||||
string_to_string = "forbid"
|
||||
suspicious_xor_used_as_pow = "forbid"
|
||||
tests_outside_test_module = "forbid"
|
||||
todo = "forbid"
|
||||
|
||||
+1
-1
@@ -148,11 +148,11 @@ fn get_file_info(file_path: &Path) -> Option<BY_HANDLE_FILE_INFORMATION> {
|
||||
|
||||
let mut info = BY_HANDLE_FILE_INFORMATION::default();
|
||||
|
||||
// SAFETY: This is safe because the file handles and the info struct pointers are all valid until this function exits.
|
||||
#[expect(
|
||||
unsafe_code,
|
||||
reason = "There is currently no way to get this data safely"
|
||||
)]
|
||||
// SAFETY: This is safe because the file handles and the info struct pointers are all valid until this function exits.
|
||||
let result = unsafe { GetFileInformationByHandle(file.as_raw_handle(), &raw mut info) };
|
||||
|
||||
(result != 0).then_some(info)
|
||||
|
||||
Reference in New Issue
Block a user