Use newtype_index!-generated types more idiomatically

This commit is contained in:
Yotam Ofek 2025-04-14 15:52:25 +00:00
parent c580c498a1
commit 4b63362f3d
20 changed files with 61 additions and 87 deletions

View file

@ -47,12 +47,9 @@ impl DefPathTable {
debug_assert_eq!(self.stable_crate_id, def_path_hash.stable_crate_id());
let local_hash = def_path_hash.local_hash();
let index = {
let index = DefIndex::from(self.index_to_key.len());
debug!("DefPathTable::insert() - {:?} <-> {:?}", key, index);
self.index_to_key.push(key);
index
};
let index = self.index_to_key.push(key);
debug!("DefPathTable::insert() - {key:?} <-> {index:?}");
self.def_path_hashes.push(local_hash);
debug_assert!(self.def_path_hashes.len() == self.index_to_key.len());