Harder, better, faster, stronger refactoring.

This commit is contained in:
elvis
2025-08-17 02:53:56 +02:00
parent 397cf20008
commit e409a5a6c2
3 changed files with 65 additions and 29 deletions

View File

@ -92,12 +92,8 @@ impl fmt::Display for Unary {
Self::Empty => write!(f, ".empty"),
Self::Length => write!(f, ".length"),
Self::ToStr => write!(f, ".tostr"),
Self::Qualifier(q) => write!(f, ".{q}"),
Self::ToEl => write!(f, ".toel"),
Self::Source => write!(f, ".source"),
Self::Target => write!(f, ".target"),
Self::Neighbours => write!(f, ".neighbours"),
Self::System => write!(f, ".system"),
Self::Qualifier(q) => write!(f, ".{q}"),
}
}
}
@ -135,12 +131,32 @@ impl fmt::Display for QualifierSystem {
}
}
impl fmt::Display for QualifierEdge {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Source => write!(f, "source"),
Self::Target => write!(f, "target"),
}
}
}
impl fmt::Display for QualifierNode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Neighbours => write!(f, "neighbours"),
Self::System => write!(f, "system"),
}
}
}
impl fmt::Display for Qualifier {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Label(q) => write!(f, "{q}"),
Self::Restricted(q) => write!(f, "{q}"),
Self::System(q) => write!(f, "{q}"),
Self::Edge(q) => write!(f, "{q}"),
Self::Node(q) => write!(f, "{q}"),
}
}
}