From 1ca34a123d41d3c3ddbdbba876dd0a088939bf49 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 12 Nov 2024 10:02:30 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> --- bzip2.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bzip2.rs b/bzip2.rs index dd350f8dc..6b69b4718 100644 --- a/bzip2.rs +++ b/bzip2.rs @@ -485,7 +485,6 @@ unsafe fn uncompressStream(zStream: *mut FILE, stream: *mut FILE) -> bool { unsafe fn testStream(zStream: *mut FILE) -> bool { let mut bzf: *mut libc::c_void; let mut bzerr: i32 = 0; - let ret: i32; let mut i: i32; let mut obuf: [u8; 5000] = [0; 5000]; let mut unused: [u8; 5000] = [0; 5000]; @@ -527,7 +526,7 @@ unsafe fn testStream(zStream: *mut FILE) -> bool { break 'errhandler; } - let mut unusedTmpV: *mut libc::c_void = std::ptr::null_mut::(); + let mut unusedTmpV = std::ptr::null_mut(); BZ2_bzReadGetUnused(&mut bzerr, bzf, &mut unusedTmpV, &mut nUnused); if bzerr != libbzip2_rs_sys::BZ_OK { panic_str("test:bzReadGetUnused"); @@ -552,8 +551,7 @@ unsafe fn testStream(zStream: *mut FILE) -> bool { if ferror(zStream) != 0 { ioError() // diverges } - ret = fclose(zStream); - if ret == libc::EOF { + if fclose(zStream) == libc::EOF { ioError() // diverges }