From 1face6efda82d571593e3f9c2f9a007d7e8b32f6 Mon Sep 17 00:00:00 2001 From: elvis Date: Fri, 15 Aug 2025 17:43:22 +0200 Subject: [PATCH] More specific visibility for assert --- src/main.rs | 2 +- src/rsprocess/assert.rs | 28 ++++++++++++++-------------- src/rsprocess/mod.rs | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main.rs b/src/main.rs index 73aa7d4..c2df342 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ fn main() { use reactionsystems::rsprocess::presets; match presets::run("testing/first.system".into()) { - Ok(_) => {}, + Ok(()) => {}, Err(e) => {println!("{e}")} } diff --git a/src/rsprocess/assert.rs b/src/rsprocess/assert.rs index d76b981..b23b177 100644 --- a/src/rsprocess/assert.rs +++ b/src/rsprocess/assert.rs @@ -160,7 +160,7 @@ pub enum QualifierRestricted { } impl QualifierRestricted { - pub fn referenced_mut<'a>( + pub(super) fn referenced_mut<'a>( &self, label: &'a mut super::structure::RSlabel, ) -> &'a mut super::structure::RSset { @@ -175,7 +175,7 @@ impl QualifierRestricted { } } - pub fn referenced<'a>( + pub(super) fn referenced<'a>( &self, label: &'a super::structure::RSlabel, ) -> &'a super::structure::RSset { @@ -200,7 +200,7 @@ pub enum QualifierLabel { } impl QualifierLabel { - pub fn get( + pub(super) fn get( &self, l: &super::structure::RSlabel, ) -> AssertReturnValue { @@ -229,7 +229,7 @@ pub enum QualifierSystem { } impl QualifierSystem { - pub fn get( + pub(super) fn get( &self, l: &super::structure::RSsystem, ) -> AssertReturnValue { @@ -413,14 +413,14 @@ struct TypeContext { } impl TypeContext { - pub fn new() -> Self { + fn new() -> Self { TypeContext { data: HashMap::new(), return_ty: None } } - pub fn assign( + fn assign( &mut self, v: &AssignmentVariable, ty: AssertionTypes @@ -452,7 +452,7 @@ impl TypeContext { } } - pub fn return_type( + fn return_type( &mut self, ty: AssertionTypes ) -> Result<(), String> { @@ -469,7 +469,7 @@ impl TypeContext { } } - pub fn assign_range( + fn assign_range( &mut self, v: &Variable, ty: AssertionTypes @@ -499,7 +499,7 @@ impl TypeContext { } } - pub fn get( + fn get( &self, v: &AssignmentVariable, ) -> Result { @@ -545,14 +545,14 @@ struct Context<'a> { } impl<'a> Context<'a> { - pub fn new( + fn new( label: &'a super::structure::RSlabel, edge: &'a petgraph::graph::EdgeIndex, ) -> Self { Self { data: HashMap::new(), label, edge } } - pub fn assign( + fn assign( &mut self, v: &AssignmentVariable, val: AssertReturnValue, @@ -610,7 +610,7 @@ impl<'a> Context<'a> { } } - pub fn get( + fn get( &self, v: &AssignmentVariable ) -> Result { @@ -684,7 +684,7 @@ pub enum AssertReturnValue { } impl AssertReturnValue { - pub fn unary( + fn unary( self, u: &Unary, translator: &mut super::translator::Translator, @@ -753,7 +753,7 @@ impl AssertReturnValue { } } - pub fn binary( + fn binary( self, b: &Binary, other: AssertReturnValue, diff --git a/src/rsprocess/mod.rs b/src/rsprocess/mod.rs index ab2f7f0..0e818c6 100644 --- a/src/rsprocess/mod.rs +++ b/src/rsprocess/mod.rs @@ -14,6 +14,6 @@ pub mod rsdot; pub mod serialize; pub mod presets; pub mod bisimilarity; +pub mod assert; mod format_helpers; -mod assert;