Use map.entry().or_insert() instead of map.contains_key() and map.insert()

This commit is contained in:
julianbraha 2024-08-29 14:10:21 +01:00 committed by Victoria Brekenfeld
parent 536484e9da
commit 2e2356ab5f
2 changed files with 12 additions and 20 deletions

View file

@ -69,9 +69,7 @@ pub fn display_configuration(
}
}
if !map.contains_key(&conn.handle()) {
map.insert(conn.handle(), None);
}
map.entry(conn.handle()).or_insert(None);
}
// And then cleanup