From 6546844ca4274cd11ec2c91da7c6d7b5e8a82d0b Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 4 Dec 2025 15:10:40 -0500 Subject: [Rust] Fix misc clippy lints and warnings These are introduced after changing to Rust 1.91.1 --- rust/src/binary_view/writer.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'rust/src/binary_view/writer.rs') diff --git a/rust/src/binary_view/writer.rs b/rust/src/binary_view/writer.rs index 176a54d8..ca570761 100644 --- a/rust/src/binary_view/writer.rs +++ b/rust/src/binary_view/writer.rs @@ -21,7 +21,7 @@ use crate::binary_view::{BinaryView, BinaryViewBase, BinaryViewExt}; use crate::Endianness; use crate::rc::Ref; -use std::io::{ErrorKind, Seek, SeekFrom, Write}; +use std::io::{Seek, SeekFrom, Write}; pub struct BinaryWriter { view: Ref, @@ -88,10 +88,7 @@ impl Seek for BinaryWriter { let view_end = self.view.original_image_base() + self.view.len(); let offset = view_end .checked_add_signed(end_offset) - .ok_or(std::io::Error::new( - ErrorKind::Other, - "Seeking from end overflowed", - ))?; + .ok_or(std::io::Error::other("Seeking from end overflowed"))?; self.seek_to_offset(offset); } }; @@ -105,10 +102,7 @@ impl Write for BinaryWriter { let len = buf.len(); let result = unsafe { BNWriteData(self.handle, buf.as_ptr() as *mut _, len) }; if !result { - Err(std::io::Error::new( - std::io::ErrorKind::Other, - "write out of bounds", - )) + Err(std::io::Error::other("write out of bounds")) } else { Ok(len) } -- cgit v1.3.1