Skip to content

Commit

Permalink
Merge pull request #37 from ChengyuZhu6/fix-code-check
Browse files Browse the repository at this point in the history
fix clippy error
  • Loading branch information
zvonkok authored Oct 30, 2024
2 parents 19763bc + 0616d90 commit 3d3e665
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ pub(crate) fn update_annotations(
device_id: &str,
devices: Vec<String>,
) -> Result<HashMap<String, String>> {
let mut annotations = match option_annotaions {
Some(annos) => annos,
None => HashMap::new(),
};
let mut annotations = option_annotations.unwrap_or_else(HashMap::new);

let key = annotation_key(plugin_name, device_id).context("CDI annotation key failed")?;
if annotations.contains_key(&key) {
Expand Down
2 changes: 1 addition & 1 deletion src/container_edits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ impl Validate for IntelRdt {
if clos_id.len() >= 4096
|| clos_id == "."
|| clos_id == ".."
|| clos_id.contains(|c| c == '/' || c == '\n')
|| clos_id.contains(&['/', '\n'][..])
{
return Err(anyhow!("invalid clos id".to_string()));
}
Expand Down

0 comments on commit 3d3e665

Please sign in to comment.