air_script_core/
identifier.rs

1use std::fmt;
2
3/// [Identifier] is used to represent variable names.
4#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Clone)]
5pub struct Identifier(pub String);
6
7impl Identifier {
8    /// Returns the name of the identifier.
9    pub fn name(&self) -> &str {
10        &self.0
11    }
12}
13
14impl fmt::Display for Identifier {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        write!(f, "{}", &self.0)
17    }
18}