Skip to content

Commit a61a85e

Browse files
committed
Add some comments.
1 parent 2469ed0 commit a61a85e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/proc_macro/src/bridge/handle.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
88

99
pub(super) type Handle = NonZeroU32;
1010

11+
/// A store that associates values of type `T` with numeric handles. A value can
12+
/// be looked up using its handle.
1113
pub(super) struct OwnedStore<T: 'static> {
1214
counter: &'static AtomicUsize,
1315
data: BTreeMap<Handle, T>,
@@ -49,6 +51,7 @@ impl<T> IndexMut<Handle> for OwnedStore<T> {
4951
}
5052
}
5153

54+
/// Like `OwnedStore`, but avoids storing any value more than once.
5255
pub(super) struct InternedStore<T: 'static> {
5356
owned: OwnedStore<T>,
5457
interner: HashMap<T, Handle>,

0 commit comments

Comments
 (0)