Skip to main content

just/
assignment.rs

1use super::*;
2
3/// An assignment, e.g `foo := bar`
4pub(crate) type Assignment<'src> = Binding<'src, Expression<'src>>;
5
6impl Display for Assignment<'_> {
7  fn fmt(&self, f: &mut Formatter) -> fmt::Result {
8    if self.private {
9      writeln!(f, "[private]")?;
10    }
11
12    if self.export {
13      write!(f, "export ")?;
14    }
15
16    write!(f, "{} := {}", self.name, self.value)
17  }
18}