From ae3a982f47d680d813a75855e401b68020bf022c Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Wed, 30 Nov 2022 14:04:05 -0600 Subject: [PATCH] Override a clippy lint; I seem to have no other choice --- crates/egui/src/context.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 3baa5dd7..dc22846d 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -154,6 +154,11 @@ impl ContextImpl { #[cfg(feature = "accesskit")] fn accesskit_node(&mut self, id: Id, parent_id: Option) -> &mut accesskit::Node { let nodes = self.frame_state.accesskit_nodes.as_mut().unwrap(); + // We have to override clippy's map_entry lint here, because the + // insertion path also modifies another entry, to establish + // the parent/child relationship. Using `HashMap::entry` here + // would require two mutable borrows at once. + #[allow(clippy::map_entry)] if !nodes.contains_key(&id) { nodes.insert(id, Default::default()); let parent_id = parent_id.unwrap_or_else(crate::accesskit_root_id);