Override a clippy lint; I seem to have no other choice
This commit is contained in:
parent
4a273c754d
commit
ae3a982f47
1 changed files with 5 additions and 0 deletions
|
@ -154,6 +154,11 @@ impl ContextImpl {
|
||||||
#[cfg(feature = "accesskit")]
|
#[cfg(feature = "accesskit")]
|
||||||
fn accesskit_node(&mut self, id: Id, parent_id: Option<Id>) -> &mut accesskit::Node {
|
fn accesskit_node(&mut self, id: Id, parent_id: Option<Id>) -> &mut accesskit::Node {
|
||||||
let nodes = self.frame_state.accesskit_nodes.as_mut().unwrap();
|
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) {
|
if !nodes.contains_key(&id) {
|
||||||
nodes.insert(id, Default::default());
|
nodes.insert(id, Default::default());
|
||||||
let parent_id = parent_id.unwrap_or_else(crate::accesskit_root_id);
|
let parent_id = parent_id.unwrap_or_else(crate::accesskit_root_id);
|
||||||
|
|
Loading…
Reference in a new issue