chore: fix all clippy warnings
This commit is contained in:
parent
9cec2e0dc2
commit
fde56af414
13 changed files with 119 additions and 158 deletions
|
|
@ -386,6 +386,7 @@ pub enum ExtractOption {
|
|||
ClearNoChangeFFlags,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct ExtractOptions {
|
||||
pub flags: i32,
|
||||
}
|
||||
|
|
@ -420,9 +421,3 @@ impl ExtractOptions {
|
|||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ExtractOptions {
|
||||
fn default() -> ExtractOptions {
|
||||
ExtractOptions { flags: 0 }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ impl Builder {
|
|||
ffi::archive_read_support_filter_program_signature(
|
||||
self.handle_mut(),
|
||||
c_prog.as_ptr(),
|
||||
mem::transmute(cb),
|
||||
mem::transmute::<std::option::Option<extern "C" fn()>, *const std::ffi::c_void>(cb),
|
||||
size,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ impl FileWriter {
|
|||
unsafe {
|
||||
match ffi::archive_write_header(self.handle_mut(), entry.entry_mut()) {
|
||||
ffi::ARCHIVE_OK => Ok(()),
|
||||
_ => Err(ArchiveError::from(self as &dyn Handle).into()),
|
||||
_ => Err(ArchiveError::from(self as &dyn Handle)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ impl FileWriter {
|
|||
unsafe {
|
||||
match ffi::archive_write_header(self.handle_mut(), entry.entry_mut()) {
|
||||
ffi::ARCHIVE_OK => (),
|
||||
_ => return Err(ArchiveError::from(self as &dyn Handle).into()),
|
||||
_ => return Err(ArchiveError::from(self as &dyn Handle)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ impl FileWriter {
|
|||
|
||||
// Negative values signal errors
|
||||
if res < 0 {
|
||||
return Err(ArchiveError::from(self as &dyn Handle).into());
|
||||
return Err(ArchiveError::from(self as &dyn Handle));
|
||||
}
|
||||
|
||||
written += usize::try_from(res).unwrap();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,12 @@ impl Entry for WriteEntry {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for WriteEntry {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for WriteEntry {
|
||||
fn drop(&mut self) {
|
||||
unsafe { ffi::archive_entry_free(self.entry_mut()) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue