shapes_converter/shex_to_uml/
node_id.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std::fmt::Display;

#[derive(Debug, PartialEq, Eq, Default, Clone, Copy, Hash)]
pub struct NodeId {
    n: usize,
}

impl NodeId {
    pub fn new(n: usize) -> NodeId {
        NodeId { n }
    }
}

impl Display for NodeId {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.n)?;
        Ok(())
    }
}