Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Separate macro replacement from macro parsing #440

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ use std::sync::RwLock;
use lasso::{Rodeo, Spur};
use lazy_static::lazy_static;

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub struct InternedStr(pub Spur);

impl fmt::Debug for InternedStr {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self)
}
}

lazy_static! {
pub static ref STRINGS: RwLock<Rodeo<Spur>> = RwLock::new(Rodeo::default());
static ref EMPTY_STRING: InternedStr = InternedStr::get_or_intern("");
Expand Down
Loading