From 92bca9617108077ac46c4c976f26dc07bbdebef7 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 9 Sep 2026 15:39:12 +0000 Subject: [PATCH] Name the crate cluster tuple as a type alias --- tools/crate-hierarchy-viz/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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",