From c5ffaf9d3fcd026b426e3c345f5e361d3eb261f1 Mon Sep 17 00:00:00 2001 From: Marc Schoolderman Date: Tue, 18 Jun 2024 15:28:04 +0200 Subject: [PATCH] remove pub from some functions Signed-off-by: Marc Schoolderman --- examples/src/cli.rs | 7 +++++-- tsp/src/async_store.rs | 2 +- tsp/src/store.rs | 9 ++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/src/cli.rs b/examples/src/cli.rs index 73d0c76..bbdf0ec 100644 --- a/examples/src/cli.rs +++ b/examples/src/cli.rs @@ -334,7 +334,7 @@ async fn run() -> Result<(), Error> { .send(sender_vid, receiver_vid, non_confidential_data, &message) .await { - Ok(()) => {}, + Ok(()) => {} Err(e) => { tracing::error!( "error sending message from {sender_vid} to {receiver_vid}: {e}" @@ -345,7 +345,10 @@ async fn run() -> Result<(), Error> { }; if args.pretty_print { - let cesr_message = vid_database.as_store().seal_message(sender_vid, receiver_vid, non_confidential_data, &message)?.1; + let cesr_message = vid_database + .as_store() + .seal_message(sender_vid, receiver_vid, non_confidential_data, &message)? + .1; print_message(&cesr_message); } diff --git a/tsp/src/async_store.rs b/tsp/src/async_store.rs index 2d0ffae..5aa0518 100644 --- a/tsp/src/async_store.rs +++ b/tsp/src/async_store.rs @@ -51,7 +51,7 @@ impl AsyncStore { /// Expose the inner non-async database pub fn as_store(&self) -> &Store { - &self.inner + &self.inner } /// Import the database from serializable default types diff --git a/tsp/src/store.rs b/tsp/src/store.rs index be3269a..fc948d2 100644 --- a/tsp/src/store.rs +++ b/tsp/src/store.rs @@ -399,10 +399,7 @@ impl Store { } /// Resolve a route, extract the next hop and verify the route - pub fn resolve_route<'a>( - &'a self, - hop_list: &'a [&str], - ) -> Result<(String, Vec<&'a [u8]>), Error> { + fn resolve_route<'a>(&'a self, hop_list: &'a [&str]) -> Result<(String, Vec<&'a [u8]>), Error> { let Some(next_hop) = hop_list.first() else { return Err(Error::InvalidRoute( "relationship route must not be empty".into(), @@ -875,9 +872,7 @@ impl Store { Ok(()) } - //TODO: this should not be `pub` after the refactor that moves logic from async_store - //back into the "sync" store - pub fn add_nested_thread_id(&self, vid: &str, thread_id: Digest) -> Result<(), Error> { + fn add_nested_thread_id(&self, vid: &str, thread_id: Digest) -> Result<(), Error> { let mut vids = self.vids.write()?; let Some(context) = vids.get_mut(vid) else { return Err(Error::MissingVid(vid.into()));