cl-intern: Derive Default for StringInterner and TypedInterner
This commit is contained in:
parent
8675f91aca
commit
99a00875a8
@ -119,6 +119,7 @@ pub mod string_interner {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// A string interner hands out [Interned] copies of each unique string given to it.
|
/// A string interner hands out [Interned] copies of each unique string given to it.
|
||||||
|
#[derive(Default)]
|
||||||
pub struct StringInterner<'a> {
|
pub struct StringInterner<'a> {
|
||||||
arena: DroplessArena<'a>,
|
arena: DroplessArena<'a>,
|
||||||
keys: RwLock<HashSet<&'a str>>,
|
keys: RwLock<HashSet<&'a str>>,
|
||||||
@ -258,6 +259,7 @@ pub mod typed_interner {
|
|||||||
/// A [TypedInterner] hands out [Interned] references for arbitrary types.
|
/// A [TypedInterner] hands out [Interned] references for arbitrary types.
|
||||||
///
|
///
|
||||||
/// See the [module-level documentation](self) for more information.
|
/// See the [module-level documentation](self) for more information.
|
||||||
|
#[derive(Default)]
|
||||||
pub struct TypedInterner<'a, T: Eq + Hash> {
|
pub struct TypedInterner<'a, T: Eq + Hash> {
|
||||||
arena: TypedArena<'a, T>,
|
arena: TypedArena<'a, T>,
|
||||||
keys: RwLock<HashSet<&'a T>>,
|
keys: RwLock<HashSet<&'a T>>,
|
||||||
|
Loading…
Reference in New Issue
Block a user