Skip to content

Commit

Permalink
Merge pull request #383 from bgurney-rh/clippy-1.83
Browse files Browse the repository at this point in the history
Fix Rust 1.83 clippy errors
  • Loading branch information
mulkieran authored Dec 2, 2024
2 parents f63fc4a + b789825 commit ad30fec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<'a> TryInto<CryptParamsLuks1Ref<'a>> for &'a CryptParamsLuks1 {
}
}

impl<'a> CryptParams for CryptParamsLuks1Ref<'a> {
impl CryptParams for CryptParamsLuks1Ref<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_luks1).cast::<c_void>()
}
Expand Down Expand Up @@ -253,7 +253,7 @@ impl<'a> TryInto<CryptParamsLuks2Ref<'a>> for &'a CryptParamsLuks2 {
}
}

impl<'a> CryptParams for CryptParamsLuks2Ref<'a> {
impl CryptParams for CryptParamsLuks2Ref<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_luks2).cast::<c_void>()
}
Expand Down Expand Up @@ -363,7 +363,7 @@ impl<'a> TryInto<CryptParamsVerityRef<'a>> for &'a CryptParamsVerity {
}
}

impl<'a> CryptParams for CryptParamsVerityRef<'a> {
impl CryptParams for CryptParamsVerityRef<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_verity).cast::<c_void>()
}
Expand Down Expand Up @@ -418,7 +418,7 @@ impl<'a> TryInto<CryptParamsLoopaesRef<'a>> for &'a CryptParamsLoopaes {
}
}

impl<'a> CryptParams for CryptParamsLoopaesRef<'a> {
impl CryptParams for CryptParamsLoopaesRef<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_loopaes).cast::<c_void>()
}
Expand Down Expand Up @@ -535,7 +535,7 @@ impl<'a> TryFrom<&'a libcryptsetup_rs_sys::crypt_params_integrity> for CryptPara
}
}

impl<'a> CryptParams for CryptParamsIntegrityRef<'a> {
impl CryptParams for CryptParamsIntegrityRef<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_integrity).cast::<c_void>()
}
Expand Down Expand Up @@ -598,7 +598,7 @@ impl<'a> TryFrom<&'a libcryptsetup_rs_sys::crypt_params_plain> for CryptParamsPl
}
}

impl<'a> CryptParams for CryptParamsPlainRef<'a> {
impl CryptParams for CryptParamsPlainRef<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_plain).cast::<c_void>()
}
Expand Down Expand Up @@ -714,7 +714,7 @@ impl<'a> TryFrom<&'a libcryptsetup_rs_sys::crypt_params_tcrypt> for CryptParamsT
}
}

impl<'a> CryptParams for CryptParamsTcryptRef<'a> {
impl CryptParams for CryptParamsTcryptRef<'_> {
fn as_ptr(&mut self) -> *mut c_void {
(&mut self.inner as *mut crypt_params_tcrypt).cast::<c_void>()
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mod keyslot;
mod log;
mod luks2;
mod mem;
#[allow(clippy::all)]
#[cfg(feature = "mutex")]
mod mutex;
mod runtime;
Expand Down
4 changes: 2 additions & 2 deletions src/luks2/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl<'a, T> CryptLuks2FlagsHandle<'a, T> {
}
}

impl<'a> CryptLuks2FlagsHandle<'a, CryptActivate> {
impl CryptLuks2FlagsHandle<'_, CryptActivate> {
/// Implementation for setting persistent flags for activation
pub fn persistent_flags_set(&mut self, flags: CryptActivate) -> Result<(), LibcryptErr> {
errno!(mutex!(libcryptsetup_rs_sys::crypt_persistent_flags_set(
Expand All @@ -52,7 +52,7 @@ impl<'a> CryptLuks2FlagsHandle<'a, CryptActivate> {
}
}

impl<'a> CryptLuks2FlagsHandle<'a, CryptRequirement> {
impl CryptLuks2FlagsHandle<'_, CryptRequirement> {
/// Implementation for setting persistent flags for requirements
pub fn persistent_flags_set(&mut self, flags: CryptRequirement) -> Result<(), LibcryptErr> {
errno!(unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/luks2/reencrypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct CryptParamsReencryptRef<'a> {
hash_cstring: CString,
}

impl<'a> CryptParamsReencryptRef<'a> {
impl CryptParamsReencryptRef<'_> {
fn as_ptr(&self) -> *const crypt_params_reencrypt {
(&self.inner as *const crypt_params_reencrypt).cast::<crypt_params_reencrypt>()
}
Expand Down

0 comments on commit ad30fec

Please sign in to comment.