use std::{ fmt::{self, Display, Formatter}, sync::Arc, }; #[derive(Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)] pub struct Identifier(Arc); impl Identifier { pub fn new(string: T) -> Self { Identifier(Arc::new(string.to_string())) } pub fn as_str(&self) -> &str { self.0.as_str() } } impl Display for Identifier { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "{}", self.0) } }