Use map.entry().or_insert() instead of map.contains_key() and map.insert()
This commit is contained in:
parent
536484e9da
commit
2e2356ab5f
2 changed files with 12 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue