1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-09 08:57:25 +00:00

Lint: Fix cargo clippy errors for s390x

Some linting errors were identified during the enablement of `make check`.
These have not been found by the Jenkins CI job because `make test` was
only triggered.

The errors for the `agent` occurs under the s390x specific tests while
the other ones for the `kata-ctl` are the architecture-specific code.

This commit is to fix those errors.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
This commit is contained in:
Hyounggyu Choi 2023-11-21 16:06:01 +01:00
parent a1f288e5d3
commit c0f57c9e0a
2 changed files with 4 additions and 9 deletions
src
agent/src
tools/kata-ctl/src/arch/s390x

View File

@ -1563,7 +1563,7 @@ mod tests {
// Valid path
let device = ccw::Device::from_str(relpath).unwrap();
let matcher = VirtioBlkCCWMatcher::new(&root_bus, &device);
let matcher = VirtioBlkCCWMatcher::new(root_bus, &device);
assert!(matcher.is_match(&uev));
// Invalid paths
@ -1794,12 +1794,7 @@ mod tests {
assert!(!matcher.is_match(&uev_remove));
let mut uev_other_device = uev.clone();
uev_other_device.devpath = format!(
"{}/card{}/{}",
AP_ROOT_BUS_PATH,
card,
format!("{}.0002", card)
);
uev_other_device.devpath = format!("{}/card{}/{}.0002", AP_ROOT_BUS_PATH, card, card);
assert!(!matcher.is_match(&uev_other_device));
}
}

View File

@ -104,11 +104,11 @@ mod arch_specific {
let check_fn = if search_values.is_empty() {
|param: &str, search_param: &str, _search_values: &[&str]| {
return param.eq_ignore_ascii_case(search_param);
param.eq_ignore_ascii_case(search_param)
}
} else {
|param: &str, search_param: &str, search_values: &[&str]| {
let split: Vec<&str> = param.splitn(2, "=").collect();
let split: Vec<&str> = param.splitn(2, '=').collect();
if split.len() < 2 || split[0] != search_param {
return false;
}