mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 04:18:53 +00:00
warning_fix: fix warnings when build with cargo-1.68.0
Fixes: #6593 Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -225,7 +225,7 @@ mod arch_specific {
|
||||
expected_param_value
|
||||
);
|
||||
|
||||
return Err(anyhow!("{} {}", error_msg, action_msg));
|
||||
Err(anyhow!("{} {}", error_msg, action_msg))
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -326,9 +326,7 @@ fn setup_client(server_url: String, dbg_console_port: u32) -> anyhow::Result<Uni
|
||||
vsock.setup_sock().context("set up vsock")
|
||||
}
|
||||
// Others will be INVALID URI.
|
||||
_ => {
|
||||
return Err(anyhow!("invalid URI scheme: {:?}", scheme));
|
||||
}
|
||||
_ => Err(anyhow!("invalid URI scheme: {:?}", scheme)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -162,7 +162,7 @@ pub fn get_sandbox_id_for_volume(volume_path: &str) -> Result<String> {
|
||||
return Ok(String::from(file_name));
|
||||
}
|
||||
|
||||
return Err(anyhow!("no sandbox found for {}", volume_path));
|
||||
Err(anyhow!("no sandbox found for {}", volume_path))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@@ -53,7 +53,7 @@ const UNKNOWN: &str = "unknown";
|
||||
fn get_field_fn(line: &str, delimiter: &str, file_name: &str) -> Result<String> {
|
||||
let fields: Vec<&str> = line.split(delimiter).collect();
|
||||
if fields.len() < 2 {
|
||||
return Err(anyhow!("Unexpected file contents for {}", file_name));
|
||||
Err(anyhow!("Unexpected file contents for {}", file_name))
|
||||
} else {
|
||||
let val = fields[1].trim();
|
||||
Ok(String::from(val))
|
||||
|
Reference in New Issue
Block a user