From 397cf20008c1e2fb479aa41f618de7a722f391f8 Mon Sep 17 00:00:00 2001 From: elvis Date: Sun, 17 Aug 2025 01:31:41 +0200 Subject: [PATCH] Removed include! --- src/rsprocess/assert/dsl.rs | 23 +++++++++++------------ src/rsprocess/assert/fmt.rs | 1 + src/rsprocess/assert/mod.rs | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/rsprocess/assert/dsl.rs b/src/rsprocess/assert/dsl.rs index 9a74573..bfd3f4a 100644 --- a/src/rsprocess/assert/dsl.rs +++ b/src/rsprocess/assert/dsl.rs @@ -133,7 +133,7 @@ pub enum Binary { } #[derive(Debug, Copy, Clone, PartialEq, Eq)] -enum AssertionTypes { +pub(super) enum AssertionTypes { Boolean, Integer, String, @@ -246,7 +246,7 @@ impl QualifierSystem { } impl Unary { - fn is_prefix(&self) -> bool { + pub(super) fn is_prefix(&self) -> bool { match self { Self::Not | Self::Rand => true, @@ -262,11 +262,11 @@ impl Unary { } } - fn is_suffix(&self) -> bool { + pub(super) fn is_suffix(&self) -> bool { !self.is_prefix() } - fn associate( + pub(super) fn associate( &self, type_exp: &AssertionTypes ) -> Result { @@ -330,7 +330,7 @@ impl Unary { } impl Binary { - fn is_prefix(&self) -> bool { + pub(super) fn is_prefix(&self) -> bool { match self { Self::And | Self::Or | @@ -355,11 +355,11 @@ impl Binary { } } - fn is_suffix(&self) -> bool { + pub(super) fn is_suffix(&self) -> bool { false } - fn is_infix(&self) -> bool { + pub(super) fn is_infix(&self) -> bool { match self { Self::And | Self::Or | @@ -384,7 +384,7 @@ impl Binary { } } - fn associate( + pub(super) fn associate( &self, t1: &AssertionTypes, t2: &AssertionTypes @@ -469,8 +469,9 @@ impl Binary { } impl AssertReturnValue { - pub fn assign_qualified(&mut self, q: Qualifier, val: AssertReturnValue) - -> Result<(), String> { + pub(super) fn assign_qualified( + &mut self, q: Qualifier, val: AssertReturnValue + ) -> Result<(), String> { match (self, q, val) { (Self::Label(l), Qualifier::Restricted(q), @@ -1244,5 +1245,3 @@ impl RSassert { } } } - -include!("fmt.rs"); diff --git a/src/rsprocess/assert/fmt.rs b/src/rsprocess/assert/fmt.rs index b07bd62..42cbfe7 100644 --- a/src/rsprocess/assert/fmt.rs +++ b/src/rsprocess/assert/fmt.rs @@ -2,6 +2,7 @@ // Display Implementation for all types // ----------------------------------------------------------------------------- use std::fmt; +use super::dsl::*; impl fmt::Display for RSassert where S: fmt::Display { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/src/rsprocess/assert/mod.rs b/src/rsprocess/assert/mod.rs index ca87ae8..78fb31e 100644 --- a/src/rsprocess/assert/mod.rs +++ b/src/rsprocess/assert/mod.rs @@ -1,4 +1,6 @@ pub mod dsl; +mod fmt; + #[cfg(test)] mod tests;