From b12c5d466ff804f5d52e3a09d20b9382bbefc720 Mon Sep 17 00:00:00 2001 From: James Archer Date: Wed, 4 Sep 2024 15:43:21 +1000 Subject: [PATCH] clippy Signed-off-by: James Archer --- tool/microkit/src/sdf.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tool/microkit/src/sdf.rs b/tool/microkit/src/sdf.rs index a01b653d1..dd8c84aed 100644 --- a/tool/microkit/src/sdf.rs +++ b/tool/microkit/src/sdf.rs @@ -951,15 +951,16 @@ impl DomainSchedule { )); } - let id = { - if !domain_ids.contains_key(&name.to_string()) { - domain_ids.insert(name.to_string(), next_domain_id); + let id = match domain_ids.get(name) { + Some(&id) => id, + None => { + let id = next_domain_id; next_domain_id += 1; + domain_ids.insert(name.to_string(), id); + id } - *domain_ids.get(&name.to_string()).unwrap() }; - domain_ids.insert(name.to_string(), id); schedule.push(DomainTimeslice { id, length: length.unwrap(),