diff --git a/src-rust/src/buffers.rs b/src-rust/src/buffers.rs index b1e5d2f..5129a45 100644 --- a/src-rust/src/buffers.rs +++ b/src-rust/src/buffers.rs @@ -10,7 +10,6 @@ use crate::utilities::disable_write_xor_execute::{ use crate::utilities::icache_clear::clear_instruction_cache; use crate::utilities::mathematics::round_up; use core::ptr::{copy_nonoverlapping, NonNull}; -use core::u8; pub struct Buffers {} @@ -242,7 +241,7 @@ mod tests { fn allocate_private_memory_in_2gib() { let mut settings = BufferAllocatorSettings::new(); settings.min_address = 0; - settings.max_address = std::i32::MAX as usize; + settings.max_address = i32::MAX as usize; let result = Buffers::allocate_private_memory(&mut settings); assert!(result.is_ok()); @@ -412,7 +411,7 @@ mod tests { #[test] fn get_buffer_with_proximity() { const SIZE: usize = 4096; - let base_address = get_sys_info().max_address - (std::i32::MAX as usize); + let base_address = get_sys_info().max_address - (i32::MAX as usize); unsafe { LocatorHeaderFinder::reset(); diff --git a/src-rust/src/c/buffers_c_buffers.rs b/src-rust/src/c/buffers_c_buffers.rs index 0e2cf89..ac7c642 100644 --- a/src-rust/src/c/buffers_c_buffers.rs +++ b/src-rust/src/c/buffers_c_buffers.rs @@ -346,14 +346,13 @@ mod tests { utilities::cached::get_sys_info, }; use rstest::rstest; - use std; #[cfg(not(target_os = "macos"))] #[test] fn allocate_private_memory_in_2gib() { let mut settings = BufferAllocatorSettings::new(); settings.min_address = 0; - settings.max_address = std::i32::MAX as usize; + settings.max_address = i32::MAX as usize; let result = buffers_allocate_private_memory(&mut settings); assert!(result.is_ok); @@ -430,14 +429,13 @@ mod tests { #[test] fn get_buffer_with_proximity() { const SIZE: usize = 4096; - let base_address = get_sys_info().max_address - (std::i32::MAX as usize); + let base_address = get_sys_info().max_address - (i32::MAX as usize); unsafe { LocatorHeaderFinder::reset(); } - let settings = - buffersearchsettings_from_proximity(std::i32::MAX as usize, base_address, SIZE); + let settings = buffersearchsettings_from_proximity(i32::MAX as usize, base_address, SIZE); let result = buffers_get_buffer(&settings); diff --git a/src-rust/src/utilities/linux_map_parser.rs b/src-rust/src/utilities/linux_map_parser.rs index b48dfbd..553caff 100644 --- a/src-rust/src/utilities/linux_map_parser.rs +++ b/src-rust/src/utilities/linux_map_parser.rs @@ -112,6 +112,7 @@ pub fn get_free_regions_from_process_id(process_id: i32) -> Vec get_free_regions(®ions) } +#[allow(clippy::comparison_chain)] unsafe fn read_to_string(path: &str) -> String { const BUFFER_SIZE: usize = 131_072; // 128 KB let c_path = CString::new(path).unwrap();