From ebc2d40875c7c661dd6d2508f8e825b82763bd39 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Sun, 19 Jul 2020 06:01:05 +1200 Subject: [PATCH] Expose more registry APIs (#2215) --- crates/nu-cli/src/context.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/nu-cli/src/context.rs b/crates/nu-cli/src/context.rs index 021056875c..09c0741658 100644 --- a/crates/nu-cli/src/context.rs +++ b/crates/nu-cli/src/context.rs @@ -40,30 +40,30 @@ impl CommandRegistry { } impl CommandRegistry { - pub(crate) fn get_command(&self, name: &str) -> Option { + pub fn get_command(&self, name: &str) -> Option { let registry = self.registry.lock(); registry.get(name).cloned() } - pub(crate) fn expect_command(&self, name: &str) -> Result { + pub fn expect_command(&self, name: &str) -> Result { self.get_command(name).ok_or_else(|| { ShellError::untagged_runtime_error(format!("Could not load command: {}", name)) }) } - pub(crate) fn has(&self, name: &str) -> bool { + pub fn has(&self, name: &str) -> bool { let registry = self.registry.lock(); registry.contains_key(name) } - pub(crate) fn insert(&mut self, name: impl Into, command: Command) { + pub fn insert(&mut self, name: impl Into, command: Command) { let mut registry = self.registry.lock(); registry.insert(name.into(), command); } - pub(crate) fn names(&self) -> Vec { + pub fn names(&self) -> Vec { let registry = self.registry.lock(); registry.keys().cloned().collect() }