diff options
| author | Mason Reed <mason@vector35.com> | 2025-12-04 15:10:40 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-12-05 12:26:29 -0500 |
| commit | 6546844ca4274cd11ec2c91da7c6d7b5e8a82d0b (patch) | |
| tree | 7341b815993247cba9df7ea95585ce9723510fa0 /rust/src/binary_view/reader.rs | |
| parent | 6eb12c3c3f53079a822881bf6e197105b25a0fe3 (diff) | |
[Rust] Fix misc clippy lints and warnings
These are introduced after changing to Rust 1.91.1
Diffstat (limited to 'rust/src/binary_view/reader.rs')
| -rw-r--r-- | rust/src/binary_view/reader.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/rust/src/binary_view/reader.rs b/rust/src/binary_view/reader.rs index 685914e2..3ec105fc 100644 --- a/rust/src/binary_view/reader.rs +++ b/rust/src/binary_view/reader.rs @@ -21,7 +21,7 @@ use crate::binary_view::{BinaryView, BinaryViewBase}; use crate::Endianness; use crate::rc::Ref; -use std::io::{ErrorKind, Read, Seek, SeekFrom}; +use std::io::{Read, Seek, SeekFrom}; pub struct BinaryReader { view: Ref<BinaryView>, @@ -107,14 +107,11 @@ impl Seek for BinaryReader { SeekFrom::End(end_offset) => { // We do NOT need to add the image base here as // the reader (unlike the writer) can set the virtual base. - let offset = - self.view - .len() - .checked_add_signed(end_offset) - .ok_or(std::io::Error::new( - ErrorKind::Other, - "Seeking from end overflowed", - ))?; + let offset = self + .view + .len() + .checked_add_signed(end_offset) + .ok_or(std::io::Error::other("Seeking from end overflowed"))?; self.seek_to_offset(offset); } }; @@ -130,7 +127,7 @@ impl Read for BinaryReader { let result = unsafe { BNReadData(self.handle, buf.as_mut_ptr() as *mut _, len) }; if !result { - Err(std::io::Error::new(ErrorKind::Other, "Read out of bounds")) + Err(std::io::Error::other("Read out of bounds")) } else { Ok(len) } |
