bumpalo-intern 0.2.1

String intern utility combined with Bumpalo.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use bumpalo_intern::direct::{FromInterned, InternedStr};

#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
struct MyInterned<'a>(InternedStr<'a>);

impl<'arena> FromInterned<'arena> for MyInterned<'arena> {
    fn from_interned(v: InternedStr<'arena>) -> Self {
        Self(v)
    }

    fn as_interned(&self) -> InternedStr<'arena> {
        self.0
    }
}