mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
build: Remove unnecessary Result<> returns
If the function can never return an error this is now a clippy failure:
error: this function's return value is unnecessarily wrapped by `Result`
--> virtio-devices/src/watchdog.rs:215:5
|
215 | / fn set_state(&mut self, state: &WatchdogState) -> io::Result<()> {
216 | | self.common.avail_features = state.avail_features;
217 | | self.common.acked_features = state.acked_features;
218 | | // When restoring enable the watchdog if it was previously enabled. We reset the timer
... |
223 | | Ok(())
224 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -144,9 +144,8 @@ impl SoftTLB {
|
||||
}
|
||||
|
||||
// Adds a gva -> gpa mapping into the TLB.
|
||||
fn add_mapping(&mut self, gva: u64, gpa: u64) -> Result<(), PlatformError> {
|
||||
fn add_mapping(&mut self, gva: u64, gpa: u64) {
|
||||
*self.addr_map.entry(gva).or_insert(gpa) = gpa;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Do the actual gva -> gpa translation
|
||||
@@ -383,8 +382,7 @@ impl cpu::Vcpu for MshvVcpu {
|
||||
// Add the GVA <-> GPA mapping.
|
||||
context
|
||||
.tlb
|
||||
.add_mapping(info.guest_virtual_address, info.guest_physical_address)
|
||||
.map_err(|e| cpu::HypervisorCpuError::RunVcpu(e.into()))?;
|
||||
.add_mapping(info.guest_virtual_address, info.guest_physical_address);
|
||||
|
||||
// Create a new emulator.
|
||||
let mut emul = Emulator::new(&mut context);
|
||||
|
||||
Reference in New Issue
Block a user