pub fn parse_string_without_instances(input: &str) -> Result<Self, MonikerError> {
        if input.chars().nth(0) != Some('/') {
            return Err(MonikerError::invalid_moniker(input));
        }
        if input == "/" {
            return Ok(Self::root());
        }
        let path = input[1..]
            .split('/')
            .map(PartialMoniker::parse)
            .map(|p| p.map(|ok_p| ChildMoniker::from_partial(&ok_p, 0)))
            .collect::<Result<_, MonikerError>>()?;
        Ok(Self::new(path))
    }
/// 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".
// TODO(fxbug.dev/49968): Remove instance ID 0 assumption when removing instance IDs from
// AbsoluteMoniker/ChildMoniker (and rename to parse_str + add From<&str> impl).
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 .
pub fn parse_string_without_instances(input: &str) -> Result<Self, MonikerError> {
        if input.chars().nth(0) != Some('/') {
            return Err(MonikerError::invalid_moniker(input));
        }
        if input == "/" {
            return Ok(Self::root());
        }
        let path = input[1..]
            .split('/')
            .map(PartialMoniker::parse)
            .map(|p| p.map(|ok_p| ChildMoniker::from_partial(&ok_p, 0)))
            .collect::<Result<_, MonikerError>>()?;
        Ok(Self::new(path))
    }
pub fn parse_string_without_instances ( input : & str ) -> Result < Self , MonikerError > { if input . chars ( ) . nth ( 0 ) != Some ( '/' ) { return Err ( MonikerError :: invalid_moniker ( input ) ) ; } if input == " " { return Ok ( Self :: root ( ) ) ; } let path = input [ 1 .. ] . split ( '/' ) . map ( PartialMoniker :: parse ) . map ( | p | p . map ( | ok_p | ChildMoniker :: from_partial ( & ok_p , 0 ) ) ) . collect :: < Result < _ , MonikerError > > ( ) ? ; Ok ( Self :: new ( path ) ) }
Parse the given string as an absolute moniker.
Parse the given string as an absolute moniker .
input
&str
input
&str