/// Parse the given string as an absolute moniker. The string should be a '/' delimited series
/// of child monikers without any instance identifiers, e.g. "/", or "/name1/name2" or
/// "/name1:collection1".
Parse the given string as an absolute moniker. The string should be a '/' delimited series
of child monikers without any instance identifiers, e.g.
Parse the given string as an absolute moniker . The string should be a ' / ' delimited series of child monikers without any instance identifiers e . g .
fn parse_str(input: &str) -> Result<AbsoluteMoniker, MonikerError> {
        if input.chars().nth(0) != Some('/') {
            return Err(MonikerError::invalid_moniker(input));
        }
        if input == "/" {
            return Ok(AbsoluteMoniker::root());
        }
        let path =
            input[1..].split('/').map(ChildMoniker::parse).collect::<Result<_, MonikerError>>()?;
        Ok(AbsoluteMoniker::new(path))
    }
fn parse_str ( input : & str ) -> Result < AbsoluteMoniker , MonikerError > { if input . chars ( ) . nth ( 0 ) != Some ( '/' ) { return Err ( MonikerError :: invalid_moniker ( input ) ) ; } if input == " " { return Ok ( AbsoluteMoniker :: root ( ) ) ; } let path = input [ 1 .. ] . split ( '/' ) . map ( ChildMoniker :: parse ) . collect :: < Result < _ , MonikerError > > ( ) ? ; Ok ( AbsoluteMoniker :: new ( path ) ) }
Parse the given string as an absolute moniker.
Parse the given string as an absolute moniker .
input
&str