1 2 3 4 5 6 7 8 9 10 11 12
use std::fmt::{Display, Error, Formatter}; use Node; impl Display for Node { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { self.operator.fmt(f)?; for child in self.children() { write!(f, " {}", child)?; } Ok(()) } }