From 45be2ff1f5bb3d6e0faa098402adf985b3d5e7ca Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 4 May 2019 12:38:36 +0200 Subject: Rename dhall_core to dhall_syntax --- dhall_core/src/label.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 dhall_core/src/label.rs (limited to 'dhall_core/src/label.rs') diff --git a/dhall_core/src/label.rs b/dhall_core/src/label.rs deleted file mode 100644 index 43c3f53..0000000 --- a/dhall_core/src/label.rs +++ /dev/null @@ -1,34 +0,0 @@ -use std::rc::Rc; - -// The type for labels throughout the AST -// It owns the data because otherwise lifetimes would make recursive imports impossible -#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub struct Label(Rc); - -impl From for Label { - fn from(s: String) -> Self { - let s: &str = &s; - Label(s.into()) - } -} - -impl<'a> From<&'a str> for Label { - fn from(s: &'a str) -> Self { - Label(Rc::from(s)) - } -} - -impl From<&Label> for String { - fn from(x: &Label) -> String { - x.0.as_ref().to_owned() - } -} - -impl Label { - pub fn from_str(s: &str) -> Label { - Label(s.into()) - } - pub fn as_ref(&self) -> &str { - self.0.as_ref() - } -} -- cgit v1.2.3