shapes_converter/shex_to_uml/
node_id.rs

1use std::fmt::Display;
2
3#[derive(Debug, PartialEq, Eq, Default, Clone, Copy, Hash)]
4pub struct NodeId {
5    n: usize,
6}
7
8impl NodeId {
9    pub fn new(n: usize) -> NodeId {
10        NodeId { n }
11    }
12}
13
14impl Display for NodeId {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        write!(f, "{}", self.n)?;
17        Ok(())
18    }
19}