diff options
author | Nadrieril | 2019-12-15 20:10:54 +0000 |
---|---|---|
committer | Nadrieril | 2019-12-15 20:10:54 +0000 |
commit | 78e9e32e1357d50313287dd2a3c437132c83aeb6 (patch) | |
tree | 0e7f6172490241f4e413102a6bf7677f2a6d27c1 /dhall_syntax/src/core/label.rs | |
parent | b11a2cd6ca50d5a4dfa71ae8cd0642fb1c75e1cf (diff) |
Move contents of dhall_syntax to dhall
Diffstat (limited to 'dhall_syntax/src/core/label.rs')
-rw-r--r-- | dhall_syntax/src/core/label.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/dhall_syntax/src/core/label.rs b/dhall_syntax/src/core/label.rs deleted file mode 100644 index 43c3f53..0000000 --- a/dhall_syntax/src/core/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<str>); - -impl From<String> 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() - } -} |