Now truly finishing the refactoring

This commit is contained in:
elvis
2025-08-24 03:57:06 +02:00
parent 9a80044a89
commit a46ab3833d
6 changed files with 31 additions and 34 deletions

View File

@ -1,4 +1,5 @@
use super::bisimilarity_paige_tarkan::{bisimilarity, bisimilarity_ignore_labels};
use super::bisimilarity_paige_tarkan::{bisimilarity,
bisimilarity_ignore_labels};
#[test]
fn identity_paige_tarjan() {

View File

@ -16,7 +16,7 @@ use petgraph::
NodeRef,
}};
pub struct RSDot<'a, G>
pub struct Dot<'a, G>
where
G: IntoEdgeReferences + IntoNodeReferences + DataMap,
{
@ -30,14 +30,14 @@ static TYPE: [&str; 2] = ["graph", "digraph"];
static EDGE: [&str; 2] = ["--", "->"];
static INDENT: &str = " ";
impl<'a, G> RSDot<'a, G>
impl<'a, G> Dot<'a, G>
where
G: IntoNodeReferences + IntoEdgeReferences + DataMap,
{
/// Create a `Dot` formatting wrapper with default configuration.
#[inline]
pub fn new(graph: G) -> Self {
RSDot {
Dot {
graph,
get_edge_attributes: &|_, _| String::new(),
get_node_attributes: &|_, _| String::new(),
@ -49,7 +49,7 @@ where
#[inline]
pub fn with_config(graph: G, config: &'a [Config]) -> Self {
let config = Configs::extract(config);
RSDot {
Dot {
graph,
get_edge_attributes: &|_, _| String::new(),
get_node_attributes: &|_, _| String::new(),
@ -65,7 +65,7 @@ where
get_node_attributes: &'a dyn Fn(G, G::NodeRef) -> String,
) -> Self {
let config = Configs::extract(config);
RSDot {
Dot {
graph,
get_edge_attributes,
get_node_attributes,
@ -167,7 +167,7 @@ macro_rules! make_config_struct {
make_config_struct!();
impl<G> RSDot<'_, G>
impl<G> Dot<'_, G>
where
G: IntoNodeReferences + IntoEdgeReferences + NodeIndexable + GraphProp + DataMap,
{
@ -254,7 +254,7 @@ where
}
}
impl<G> fmt::Display for RSDot<'_, G>
impl<G> fmt::Display for Dot<'_, G>
where
G: IntoEdgeReferences + IntoNodeReferences + NodeIndexable + GraphProp + DataMap,
G::EdgeWeight: fmt::Display,
@ -265,7 +265,7 @@ where
}
}
impl<G> fmt::LowerHex for RSDot<'_, G>
impl<G> fmt::LowerHex for Dot<'_, G>
where
G: IntoEdgeReferences + IntoNodeReferences + NodeIndexable + GraphProp + DataMap,
G::EdgeWeight: fmt::LowerHex,
@ -276,7 +276,7 @@ where
}
}
impl<G> fmt::UpperHex for RSDot<'_, G>
impl<G> fmt::UpperHex for Dot<'_, G>
where
G: IntoEdgeReferences + IntoNodeReferences + NodeIndexable + GraphProp + DataMap,
G::EdgeWeight: fmt::UpperHex,
@ -287,7 +287,7 @@ where
}
}
impl<G> fmt::Debug for RSDot<'_, G>
impl<G> fmt::Debug for Dot<'_, G>
where
G: IntoEdgeReferences + IntoNodeReferences + NodeIndexable + GraphProp + DataMap,
G::EdgeWeight: fmt::Debug,

View File

@ -1,5 +1,6 @@
//! Definitions for generating graphs from a simulation.
use petgraph::visit::{IntoEdgeReferences, IntoNodeReferences};
use petgraph::{Graph, Directed};
use std::rc::Rc;
@ -437,8 +438,6 @@ impl EdgeDisplay {
// Node ------------------------------------------------------------------------
use petgraph::visit::{IntoEdgeReferences, IntoNodeReferences};
type RSdotGraph = Graph<String, String, Directed, u32>;
type RSformatNodeTy<'a> =
dyn Fn(

View File

@ -16,7 +16,7 @@ pub mod bisimilarity;
pub mod frequency;
pub mod graph;
pub mod presets;
pub mod rsdot;
pub mod dot;
pub mod serialize;
pub mod transitions;

View File

@ -12,7 +12,6 @@ use std::rc::Rc;
use super::*;
use super::graph::MapEdges;
use super::set::Set;
use super::system;
use super::translator::Translator;
use super::super::grammar;
@ -626,7 +625,7 @@ pub fn dot(
let edge_formatter =
edge_color.generate(Rc::clone(&graph));
let dot = rsdot::RSDot::with_attr_getters(
let dot = dot::Dot::with_attr_getters(
&modified_graph,
&[],
&edge_formatter,

View File

@ -101,5 +101,3 @@ impl<'a, T> Formatter<'a, T> {
Self { data, translator }
}
}