mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-20 00:48:04 +00:00
kata-sys-utils: fix warnings for s390x
The warning reports as bwlow: ``` --> kata-sys-util/src/protection.rs:145:9 | 145 | return Err(ProtectionError::NoPerms)?; | ^^^^^^^ help: remove it | ... error: `to_string` applied to a type that implements `Display` in `format!` args --> kata-sys-util/src/protection.rs:151:16 | 151 | err.to_string() | ^^^^^^^^^^^^ help: remove this ``` Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
parent
8f88401a6a
commit
bcb5df2c40
@ -142,13 +142,13 @@ pub fn arch_guest_protection(
|
|||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn available_guest_protection() -> Result<GuestProtection, ProtectionError> {
|
pub fn available_guest_protection() -> Result<GuestProtection, ProtectionError> {
|
||||||
if !Uid::effective().is_root() {
|
if !Uid::effective().is_root() {
|
||||||
return Err(ProtectionError::NoPerms)?;
|
Err(ProtectionError::NoPerms)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let facilities = crate::cpu::retrieve_cpu_facilities().map_err(|err| {
|
let facilities = crate::cpu::retrieve_cpu_facilities().map_err(|err| {
|
||||||
ProtectionError::CheckFailed(format!(
|
ProtectionError::CheckFailed(format!(
|
||||||
"Error retrieving cpu facilities file : {}",
|
"Error retrieving cpu facilities file : {}",
|
||||||
err.to_string()
|
err
|
||||||
))
|
))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user