just/src/set.rs

20 lines
384 B
Rust
Raw Permalink 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) -> fmt::Result {
2021-06-08 01:01:27 -07:00
write!(f, "set {} := {}", self.name, self.value)
}
}