Skip to content

Commit

Permalink
make verify_and_insert pub (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc authored Feb 21, 2023
1 parent 563e3a5 commit b4e3b6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/server/rpc_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand All @@ -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,
Expand Down

0 comments on commit b4e3b6e

Please sign in to comment.