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:
Rob Bradford
2021-02-11 16:00:53 +00:00
parent 8e9a5a0dbb
commit 9c5be6f660
19 changed files with 198 additions and 334 deletions

View File

@@ -1097,11 +1097,9 @@ impl DeviceManager {
}
}
fn set_state(&mut self, state: &DeviceManagerState) -> DeviceManagerResult<()> {
fn set_state(&mut self, state: &DeviceManagerState) {
self.device_tree = Arc::new(Mutex::new(state.device_tree.clone()));
self.device_id_cnt = state.device_id_cnt;
Ok(())
}
#[cfg(target_arch = "aarch64")]
@@ -3726,9 +3724,7 @@ impl Snapshottable for DeviceManager {
MigratableError::Restore(anyhow!("Could not deserialize DeviceManager {}", e))
})?;
self.set_state(&device_manager_state).map_err(|e| {
MigratableError::Restore(anyhow!("Could not restore DeviceManager state {:?}", e))
})?;
self.set_state(&device_manager_state);
} else {
return Err(MigratableError::Restore(anyhow!(
"Could not find DeviceManager snapshot section"