Skip to content

Commit

Permalink
Make a cosmetic adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Oct 6, 2023
1 parent 06d3719 commit 05b5460
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/version2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ pub fn compress(data: &[u8], metadata: String, quality: usize, transform: bool)
transform as core::ffi::c_int,
) != 0
};
if success {
result.truncate(result_length);
Some(result)
} else {
None
if !success {
return None;
}
result.truncate(result_length);
result.into()
}

/// Decompress.
Expand All @@ -56,11 +55,10 @@ pub fn decompress(data: &[u8]) -> Option<Vec<u8>> {
data.len(),
) != 0
};
if success {
Some(result)
} else {
None
if !success {
return None;
}
result.into()
}

/// Convert.
Expand Down

0 comments on commit 05b5460

Please sign in to comment.