Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rust 1.83 clippy errors #383

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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