1
2
3
4
5
6
7
8
9
10
11
12
use crate::CodeBuffer;

/// An element with a name.
pub trait WithName {
    /// Gets the name.
    fn name(&self) -> &str;

    /// Writes the name.
    fn write_name(&self, b: &mut CodeBuffer) {
        b.write(self.name());
    }
}