From b926ef506434983d364860955f43c6b89a8c6e01 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Tue, 21 Feb 2023 10:16:03 +1300 Subject: [PATCH] make verify_and_insert pub --- core/src/server/rpc_module.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/server/rpc_module.rs b/core/src/server/rpc_module.rs index 80218537cd..5f3417b2be 100644 --- a/core/src/server/rpc_module.rs +++ b/core/src/server/rpc_module.rs @@ -330,7 +330,8 @@ impl Methods { Self::default() } - fn verify_method_name(&mut self, name: &'static str) -> Result<(), Error> { + /// Verifies that the method name is not already taken, and returns an error if it is. + pub fn verify_method_name(&mut self, name: &'static str) -> Result<(), Error> { if self.callbacks.contains_key(name) { return Err(Error::MethodAlreadyRegistered(name.into())); } @@ -340,7 +341,7 @@ impl Methods { /// Inserts the method callback for a given name, or returns an error if the name was already taken. /// On success it returns a mut reference to the [`MethodCallback`] just inserted. - fn verify_and_insert( + pub fn verify_and_insert( &mut self, name: &'static str, callback: MethodCallback,