summaryrefslogtreecommitdiff
path: root/src/syntax/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax/ast.rs')
-rw-r--r--src/syntax/ast.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 77c788d3..56d4415e 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -1577,12 +1577,17 @@ impl Ident {
_ => panic!("identifier is of wrong kind"),
}
}
+
+ /// Get the identifier as a string slice.
+ pub fn as_str(&self) -> &str {
+ self.get()
+ }
}
impl Deref for Ident {
type Target = str;
fn deref(&self) -> &Self::Target {
- self.get()
+ self.as_str()
}
}