fix clippy

This commit is contained in:
Steven Fackler 2020-06-05 13:33:13 -07:00
parent 639c8af5c1
commit 24af7de14c
4 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ jobs:
with: with:
path: target path: target
key: clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} key: clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
- name: Run clippy clippy - name: Run clippy
run: cargo clippy --all --all-targets run: cargo clippy --all --all-targets
min-version: min-version:

View File

@ -92,6 +92,7 @@ impl Seal {
} }
/// Returns the initialization vector, if the cipher uses one. /// Returns the initialization vector, if the cipher uses one.
#[allow(clippy::option_as_ref_deref)]
pub fn iv(&self) -> Option<&[u8]> { pub fn iv(&self) -> Option<&[u8]> {
self.iv.as_ref().map(|v| &**v) self.iv.as_ref().map(|v| &**v)
} }

View File

@ -229,6 +229,7 @@ impl Error {
} }
/// Returns additional data describing the error. /// Returns additional data describing the error.
#[allow(clippy::option_as_ref_deref)]
pub fn data(&self) -> Option<&str> { pub fn data(&self) -> Option<&str> {
self.data.as_ref().map(|s| &**s) self.data.as_ref().map(|s| &**s)
} }

View File

@ -46,7 +46,7 @@ unsafe impl<T: Stackable + Sync> Sync for Stack<T> {}
impl<T: Stackable> Drop for Stack<T> { impl<T: Stackable> Drop for Stack<T> {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
while let Some(_) = self.pop() {} while self.pop().is_some() {}
OPENSSL_sk_free(self.0 as *mut _); OPENSSL_sk_free(self.0 as *mut _);
} }
} }