From ccec086e25d4ba05ce76c3a24dea4519553ed000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 19 Jan 2021 14:40:13 +0100 Subject: [PATCH] clippy: remove unnecessary &mut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/backup/key_derivation.rs | 2 +- src/tape/sgutils2.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backup/key_derivation.rs b/src/backup/key_derivation.rs index 73478c00..6b6e7484 100644 --- a/src/backup/key_derivation.rs +++ b/src/backup/key_derivation.rs @@ -278,7 +278,7 @@ pub fn rsa_decrypt_key_config( let decrypted = rsa .private_decrypt(key, &mut buffer, openssl::rsa::Padding::PKCS1) .map_err(|err| format_err!("failed to decrypt KeyConfig using RSA - {}", err))?; - decrypt_key(&mut buffer[..decrypted], passphrase) + decrypt_key(&buffer[..decrypted], passphrase) } #[test] diff --git a/src/tape/sgutils2.rs b/src/tape/sgutils2.rs index 31cd61b5..65deed70 100644 --- a/src/tape/sgutils2.rs +++ b/src/tape/sgutils2.rs @@ -191,16 +191,16 @@ impl <'a, F: AsRawFd> SgRaw<'a, F> { } // todo: what about sense data? - let _sense_len = unsafe { get_scsi_pt_sense_len(&mut *ptvp) }; + let _sense_len = unsafe { get_scsi_pt_sense_len(&*ptvp) }; - let status = unsafe { get_scsi_pt_status_response(&mut *ptvp) }; + let status = unsafe { get_scsi_pt_status_response(&*ptvp) }; if status != 0 { // toto: improve error reporting bail!("unknown scsi error - status response {}", status); } let data_len = self.buffer.len() - - (unsafe { get_scsi_pt_resid(&mut *ptvp) } as usize); + (unsafe { get_scsi_pt_resid(&*ptvp) } as usize); if data_len == 0 { bail!("do_scsi_pt failed - no data received"); } @@ -248,9 +248,9 @@ impl <'a, F: AsRawFd> SgRaw<'a, F> { } // todo: what about sense data? - let _sense_len = unsafe { get_scsi_pt_sense_len(&mut *ptvp) }; + let _sense_len = unsafe { get_scsi_pt_sense_len(&*ptvp) }; - let status = unsafe { get_scsi_pt_status_response(&mut *ptvp) }; + let status = unsafe { get_scsi_pt_status_response(&*ptvp) }; if status != 0 { // toto: improve error reporting bail!("unknown scsi error - status response {}", status);