Skip to main content

strip_node_scope

Function strip_node_scope 

Source
pub fn strip_node_scope(identifier: &str) -> &str
Expand description

Strip a @scope/name node identifier down to its bare short name.

Plain (already-short) identifiers pass through unchanged, since there’s no / to split on.

§Examples

use mecha10_cli_core::utils::strip_node_scope;

assert_eq!(strip_node_scope("@mecha10/teleop"), "teleop");
assert_eq!(strip_node_scope("teleop"), "teleop");