fn candidates(root: &Path, item: &Item) -> Option<[Url; 2]> {
        let mut base = root.to_owned();

        let mut it = item.iter().peekable();
        let mut last = None;

        while let Some(c) = it.next() {
            if it.peek().is_none() {
                last = match c {
                    ComponentRef::Str(string) => Some(string),
                    _ => return None,
                };

                break;
            }

            if let ComponentRef::Str(string) = c {
                base.push(string);
            } else {
                return None;
            }
        }

        let last = last?;

        let mut a = base.clone();
        a.push(&format!("{}.rn", last));

        let mut b = base;
        b.push(last);
        b.push("mod.rn");

        let a = Url::from_file_path(&a).ok()?;
        let b = Url::from_file_path(&b).ok()?;

        Some([a, b])
    }
/// Generate a collection of URl candidates.
Generate a collection of URl candidates.
Generate a collection of URl candidates .
fn candidates(root: &Path, item: &Item) -> Option<[Url; 2]> {
        let mut base = root.to_owned();
        let mut it = item.iter().peekable();
        let mut last = None;
        while let Some(c) = it.next() {
            if it.peek().is_none() {
                last = match c {
                    ComponentRef::Str(string) => Some(string),
                    _ => return None,
                };
                break;
            }
            if let ComponentRef::Str(string) = c {
                base.push(string);
            } else {
                return None;
            }
        }
        let last = last?;
        let mut a = base.clone();
        a.push(&format!("{}.rn", last));
        let mut b = base;
        b.push(last);
        b.push("mod.rn");
        let a = Url::from_file_path(&a).ok()?;
        let b = Url::from_file_path(&b).ok()?;
        Some([a, b])
    }
fn candidates ( root : & Path , item : & Item ) -> Option < [ Url ; 2 ] > { let mut base = root . to_owned ( ) ; let mut it = item . iter ( ) . peekable ( ) ; let mut last = None ; while let Some ( c ) = it . next ( ) { if it . peek ( ) . is_none ( ) { last = match c { ComponentRef :: Str ( string ) => Some ( string ) , _ => return None , } ; break ; } if let ComponentRef :: Str ( string ) = c { base . push ( string ) ; } else { return None ; } } let last = last ? ; let mut a = base . clone ( ) ; a . push ( & format ! ( " " last ) ) ; let mut b = base ; b . push ( last ) ; b . push ( " " ) ; let a = Url :: from_file_path ( & a ) . ok ( ) ? ; let b = Url :: from_file_path ( & b ) . ok ( ) ? ; Some ( [ a , b ] ) }
Generate a collection of URl candidates.
Generate a collection of URl candidates .
root
&Path
item
&Item
root
&Path
item
&Item