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
+2 -5
View File
@@ -1726,7 +1726,7 @@ mod tests {
use super::*;
#[test]
fn test_option_parser() -> std::result::Result<(), OptionParserError> {
fn test_option_parser() {
let mut parser = OptionParser::new();
parser
.add("size")
@@ -1742,7 +1742,6 @@ mod tests {
assert_eq!(parser.get("size"), Some("128M".to_owned()));
assert!(!parser.is_set("mergeable"));
assert!(parser.is_set("size"));
Ok(())
}
#[test]
@@ -2271,7 +2270,7 @@ mod tests {
}
#[test]
fn test_config_validation() -> Result<()> {
fn test_config_validation() {
let valid_config = VmConfig {
cpus: CpusConfig {
boot_vcpus: 1,
@@ -2432,7 +2431,5 @@ mod tests {
invalid_config.memory.hugepages = true;
invalid_config.memory.hugepage_size = Some(3 << 20);
assert!(invalid_config.validate().is_err());
Ok(())
}
}