build: Fix beta clippy issue (needless_return)

warning: unneeded `return` statement
   --> pci/src/vfio_user.rs:627:13
    |
627 | /             return Err(std::io::Error::new(
628 | |                 std::io::ErrorKind::Other,
629 | |                 format!("Region not found for 0x{:x}", gpa),
630 | |             ));
    | |_______________^
    |
    = note: `#[warn(clippy::needless_return)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
627 ~             Err(std::io::Error::new(
628 +                 std::io::ErrorKind::Other,
629 +                 format!("Region not found for 0x{:x}", gpa),
630 +             ))
    |

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-06-30 16:41:46 +01:00
parent d7decfd525
commit b57d7b258d
2 changed files with 3 additions and 5 deletions

View File

@ -624,10 +624,10 @@ impl<M: GuestAddressSpace + Sync + Send> ExternalDmaMapping for VfioUserDmaMappi
)
})
} else {
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("Region not found for 0x{:x}", gpa),
));
))
}
}

View File

@ -363,9 +363,7 @@ impl MultiThreadSingleStep for GdbStub {
}
match self.vm_request(GdbRequestPayload::Resume, tid_to_cpuid(tid)) {
Ok(_) => Ok(()),
Err(e) => {
return Err(format!("Failed to resume the target: {:?}", e));
}
Err(e) => Err(format!("Failed to resume the target: {:?}", e)),
}
}
}