just/src/set.rs

20 lines
395 B
Rust
Raw Normal View History

use super::*;
2021-06-08 01:01:27 -07:00
#[derive(Debug, Clone)]
pub(crate) struct Set<'src> {
pub(crate) name: Name<'src>,
pub(crate) value: Setting<'src>,
}
impl<'src> Keyed<'src> for Set<'src> {
fn key(&self) -> &'src str {
self.name.lexeme()
}
}
2021-06-08 01:01:27 -07:00
impl<'src> Display for Set<'src> {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
write!(f, "set {} := {}", self.name, self.value)
}
}