plot/lib/display/
paths_result.rs1use super::{DrawTree, Icon};
2use crate::lib::logic::{MatchLabel, Partition, PartitioningResult};
3
4impl<L: MatchLabel> std::fmt::Display for Partition<L> {
5 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6 writeln!(f, "{}", self.label)?;
7 for path in &self.paths {
8 writeln!(f, "{} {}", DrawTree::ITEM, path)?;
9 }
10 Ok(())
11 }
12}
13
14impl std::fmt::Display for PartitioningResult {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 writeln!(f, "{} {} Matched (m): {}", DrawTree::list(0, 3), Icon::BOOL_TRUE, self.m.paths.len())?;
18 write!(f, "{} {} Mismatched (x): {}", DrawTree::list(2, 3), Icon::BOOL_FALSE, self.x.paths.len())
20 }
21}