tree-wide: use is_empty() and similar

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-12-30 14:49:11 +01:00
parent 540fca5c9e
commit 3afecb8409
6 changed files with 7 additions and 7 deletions

View File

@ -438,7 +438,7 @@ impl <'a, F: AsRawFd> SgRaw<'a, F> {
let mut ptvp = SgPt::new()?;
if self.buffer.len() > 0 {
if !self.buffer.is_empty() {
unsafe {
set_scsi_pt_data_in(
ptvp.as_mut_ptr(),
@ -579,7 +579,7 @@ impl <'a, F: AsRawFd> SgRaw<'a, F> {
return Err(format_err!("no valid SCSI command").into());
}
if data.len() == 0 {
if data.is_empty() {
return Err(format_err!("got zero-sized input buffer").into());
}