Allow direct access to the NodeId::label.

This commit is contained in:
Weird Constructor 2021-07-17 09:47:57 +02:00
parent f17e695410
commit 8c3c834907

View file

@ -905,6 +905,13 @@ macro_rules! make_node_info_enum {
} }
} }
pub fn label(&self) -> &'static str {
match self {
NodeId::$v1 => stringify!($v1),
$(NodeId::$variant(_) => stringify!($variant)),+
}
}
pub fn name(&self) -> &'static str { pub fn name(&self) -> &'static str {
match self { match self {
NodeId::$v1 => stringify!($s1), NodeId::$v1 => stringify!($s1),