Skip to main content

oxilean_std/decidable/
eqdecision_traits.rs

1//! # EqDecision - Trait Implementations
2//!
3//! This module contains trait implementations for `EqDecision`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Decidable`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::functions::Decidable;
12use super::types::{Decision, EqDecision};
13use std::fmt;
14
15impl<T: PartialEq + std::fmt::Debug> Decidable for EqDecision<T> {
16    type Proof = ();
17    fn decide(&self) -> Decision<()> {
18        if self.lhs == self.rhs {
19            Decision::IsTrue(())
20        } else {
21            Decision::IsFalse(format!("{:?} ≠ {:?}", self.lhs, self.rhs))
22        }
23    }
24}