diff --git a/tools/crate-hierarchy-viz/src/main.rs b/tools/crate-hierarchy-viz/src/main.rs index a53eff48c1..ee15631462 100644 --- a/tools/crate-hierarchy-viz/src/main.rs +++ b/tools/crate-hierarchy-viz/src/main.rs @@ -249,6 +249,9 @@ fn dot_to_svg(dot: &str) -> Result { String::from_utf8(output.stdout).with_context(|| "SVG output was not valid UTF-8") } +/// A subgraph cluster's id, label, fill color, and the predicate picking its crates. +type Cluster<'a> = (&'a str, &'a str, &'a str, Box bool>); + fn generate_dot(crates: &[CrateInfo]) -> String { let mut out = String::new(); out.push_str("digraph CrateHierarchy {\n"); @@ -257,7 +260,7 @@ fn generate_dot(crates: &[CrateInfo]) -> String { out.push_str(" edge [color=gray];\n\n"); // Define subgraph clusters - let clusters: &[(&str, &str, &str, Box bool>)] = &[ + let clusters: &[Cluster] = &[ ( "cluster_core", "Core Components",