Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tamer/src/ir/asg/graph.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/tamer/src/ir/asg/graph.rs b/tamer/src/ir/asg/graph.rs
index f6f6705..96afc3b 100644
--- a/tamer/src/ir/asg/graph.rs
+++ b/tamer/src/ir/asg/graph.rs
@@ -212,19 +212,13 @@ impl<Ix: IndexType> ObjectRef<Ix> {
}
}
-impl<Ix> From<NodeIndex<Ix>> for ObjectRef<Ix>
-where
- Ix: IndexType,
-{
+impl<Ix: IndexType> From<NodeIndex<Ix>> for ObjectRef<Ix> {
fn from(index: NodeIndex<Ix>) -> Self {
Self(index)
}
}
-impl<Ix> From<ObjectRef<Ix>> for NodeIndex<Ix>
-where
- Ix: IndexType,
-{
+impl<Ix: IndexType> From<ObjectRef<Ix>> for NodeIndex<Ix> {
fn from(objref: ObjectRef<Ix>) -> Self {
objref.0
}
@@ -246,7 +240,7 @@ pub type Node<O> = Option<O>;
/// so this stores only owned values.
/// The caller will know the problem values.
#[derive(Debug, PartialEq)]
-pub enum AsgError<Ix: Debug> {
+pub enum AsgError<Ix: IndexType> {
/// An object could not change state in the manner requested.
///
/// See [`Asg::declare`] and [`Asg::set_fragment`] for more
@@ -261,21 +255,19 @@ pub enum AsgError<Ix: Debug> {
Cycles(Vec<Vec<ObjectRef<Ix>>>),
}
-impl<Ix: Debug> std::fmt::Display for AsgError<Ix> {
+impl<Ix: IndexType> std::fmt::Display for AsgError<Ix> {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::ObjectTransition(err) => std::fmt::Display::fmt(&err, fmt),
Self::UnexpectedNode(msg) => {
write!(fmt, "unexpected node: {}", msg)
}
- Self::Cycles(cycles) => {
- write!(fmt, "Cyclic dependencies detected: {:?}", cycles)
- }
+ Self::Cycles(_) => write!(fmt, "cyclic dependencies"),
}
}
}
-impl<Ix: Debug> std::error::Error for AsgError<Ix> {
+impl<Ix: IndexType> std::error::Error for AsgError<Ix> {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Self::ObjectTransition(err) => err.source(),
@@ -284,7 +276,7 @@ impl<Ix: Debug> std::error::Error for AsgError<Ix> {
}
}
-impl<Ix: Debug> From<TransitionError> for AsgError<Ix> {
+impl<Ix: IndexType> From<TransitionError> for AsgError<Ix> {
fn from(err: TransitionError) -> Self {
Self::ObjectTransition(err)
}