Update needed for Rust v1.73.0
Bug: 303252546
Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image
Change-Id: Icbe8740b2bff6bf35fd18cdaee1518af5a11a348
diff --git a/keystore2/src/metrics_store.rs b/keystore2/src/metrics_store.rs
index 6dca74a..5a76d04 100644
--- a/keystore2/src/metrics_store.rs
+++ b/keystore2/src/metrics_store.rs
@@ -119,15 +119,14 @@
// It is ok to unwrap here since the mutex cannot be poisoned according to the way it is
// used in this module. And the lock is not acquired by this thread before.
let mut metrics_store_guard = self.metrics_store.lock().unwrap();
- let atom_count_map = metrics_store_guard.entry(atom_id).or_insert_with(HashMap::new);
+ let atom_count_map = metrics_store_guard.entry(atom_id).or_default();
if atom_count_map.len() < MetricsStore::SINGLE_ATOM_STORE_MAX_SIZE {
let atom_count = atom_count_map.entry(atom).or_insert(0);
*atom_count += 1;
} else {
// Insert an overflow atom
- let overflow_atom_count_map = metrics_store_guard
- .entry(AtomID::KEYSTORE2_ATOM_WITH_OVERFLOW)
- .or_insert_with(HashMap::new);
+ let overflow_atom_count_map =
+ metrics_store_guard.entry(AtomID::KEYSTORE2_ATOM_WITH_OVERFLOW).or_default();
if overflow_atom_count_map.len() < MetricsStore::SINGLE_ATOM_STORE_MAX_SIZE {
let overflow_atom = Keystore2AtomWithOverflow { atom_id };