Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 5, 2024
1 parent d210d5a commit ad03a70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 35 deletions.
36 changes: 7 additions & 29 deletions bzip2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ unsafe fn applySavedTimeInfoToOutputFile(mut dstName: *mut c_char) {
};
uTimBuf.actime = fileMetaInfo.st_atime;
uTimBuf.modtime = fileMetaInfo.st_mtime;
retVal = utime(dstName, &mut uTimBuf);
retVal = utime(dstName, &uTimBuf);
if retVal != 0 as libc::c_int {
ioError();
}
Expand Down Expand Up @@ -2645,36 +2645,19 @@ unsafe fn main_0(mut argc: IntNative, mut argv: *mut *mut c_char) -> IntNative {
== 0 as libc::c_int
{
noisy = 0 as Bool;
} else if strcmp(
(*aa).name,
b"--version\0" as *const u8 as *const libc::c_char,
) == 0 as libc::c_int
{
license();
exit(0 as libc::c_int);
} else if strcmp(
(*aa).name,
b"--license\0" as *const u8 as *const libc::c_char,
) == 0 as libc::c_int
} else if strcmp((*aa).name, c"--version".as_ptr()) == 0
|| strcmp((*aa).name, c"--license".as_ptr()) == 0
{
license();
exit(0 as libc::c_int);
exit(0);
} else if strcmp(
(*aa).name,
b"--exponential\0" as *const u8 as *const libc::c_char,
) == 0 as libc::c_int
{
workFactor = 1 as libc::c_int;
} else if strcmp(
(*aa).name,
b"--repetitive-best\0" as *const u8 as *const libc::c_char,
) == 0 as libc::c_int
{
redundant((*aa).name);
} else if strcmp(
(*aa).name,
b"--repetitive-fast\0" as *const u8 as *const libc::c_char,
) == 0 as libc::c_int
} else if strcmp((*aa).name, c"--repetitive-best".as_ptr()) == 0
|| strcmp((*aa).name, c"--repetitive-fast".as_ptr()) == 0
{
redundant((*aa).name);
} else if strcmp((*aa).name, b"--fast\0" as *const u8 as *const libc::c_char)
Expand Down Expand Up @@ -2852,10 +2835,5 @@ fn main() {
);
}
args.push(core::ptr::null_mut());
unsafe {
::std::process::exit(main_0(
(args.len() - 1) as IntNative,
args.as_mut_ptr() as *mut *mut c_char,
) as i32)
}
unsafe { ::std::process::exit(main_0((args.len() - 1) as IntNative, args.as_mut_ptr()) as i32) }
}
7 changes: 1 addition & 6 deletions bzip2recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,5 @@ pub fn main() {
);
}
args.push(core::ptr::null_mut());
unsafe {
::std::process::exit(main_0(
(args.len() - 1) as i32,
args.as_mut_ptr() as *mut *mut c_char,
))
}
unsafe { ::std::process::exit(main_0((args.len() - 1) as i32, args.as_mut_ptr())) }
}

0 comments on commit ad03a70

Please sign in to comment.