diff --git a/src/str.rs b/src/str.rs index c06c33dd..f49592df 100644 --- a/src/str.rs +++ b/src/str.rs @@ -118,6 +118,18 @@ impl<'a> arbitrary::Arbitrary<'a> for FunctionName { #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash)] pub struct Identifier(Arc); +impl From<&str> for Identifier { + fn from(s: &str) -> Self { + Self(Arc::from(s)) + } +} + +impl AsRef for Identifier { + fn as_ref(&self) -> &str { + &self.0 + } +} + wrapped_string!(Identifier, "variable identifier"); impl_arbitrary_lowercase_alpha!(Identifier);