clippy: misc. fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
@ -24,10 +24,7 @@ pub fn has_encryption<F: AsRawFd>(
|
||||
Ok(data) => data,
|
||||
Err(_) => return false,
|
||||
};
|
||||
match decode_spin_data_encryption_caps(&data) {
|
||||
Ok(_) => true,
|
||||
Err(_) => false,
|
||||
}
|
||||
decode_spin_data_encryption_caps(&data).is_ok()
|
||||
}
|
||||
|
||||
/// Set or clear encryption key
|
||||
|
@ -17,6 +17,7 @@ bitflags::bitflags!{
|
||||
///
|
||||
/// See LTO SCSI Reference LOG_SENSE - LP 2Eh: TapeAlerts
|
||||
pub struct TapeAlertFlags: u64 {
|
||||
#[allow(clippy::eq_op)]
|
||||
const READ_WARNING = 1 << (0x0001 -1);
|
||||
const WRITE_WARNING = 1 << (0x0002 -1);
|
||||
const HARD_ERROR = 1 << (0x0003 -1);
|
||||
|
@ -201,7 +201,7 @@ impl <'a, F: AsRawFd> SgRaw<'a, F> {
|
||||
|
||||
let data_len = self.buffer.len() -
|
||||
(unsafe { get_scsi_pt_resid(&mut *ptvp) } as usize);
|
||||
if data_len <= 0 {
|
||||
if data_len == 0 {
|
||||
bail!("do_scsi_pt failed - no data received");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user