fn find_candidate<'a>(backtrack_stack: &mut Vec<BacktrackFrame<'a>>,
                      cx: &mut Context<'a>,
                      remaining_deps: &mut BinaryHeap<DepsFrame>,
                      parent: &mut Rc<Summary>,
                      cur: &mut usize,
                      dep: &mut Dependency,
                      features: &mut Vec<String>) -> Option<Candidate> {
    while let Some(mut frame) = backtrack_stack.pop() {
        if let Some((_, candidate)) = frame.remaining_candidates.next() {
            *cx = frame.context_backup.clone();
            *remaining_deps = frame.deps_backup.clone();
            *parent = frame.parent.clone();
            *cur = remaining_deps.peek().unwrap().remaining_siblings.cur_index();
            *dep = frame.dep.clone();
            *features = frame.features.clone();
            backtrack_stack.push(frame);
            return Some(candidate)
        }
    }
    None
}
// Searches up `backtrack_stack` until it finds a dependency with remaining
// candidates. Resets `cx` and `remaining_deps` to that level and returns the
// next candidate. If all candidates have been exhausted, returns None.
Searches up `backtrack_stack` until it finds a dependency with remaining
candidates. Resets `cx` and `remaining_deps` to that level and returns the
next candidate. If all candidates have been exhausted, returns None.
Searches up ` backtrack_stack ` until it finds a dependency with remaining candidates . Resets ` cx ` and ` remaining_deps ` to that level and returns the next candidate . If all candidates have been exhausted returns None .
fn find_candidate<'a>(backtrack_stack: &mut Vec<BacktrackFrame<'a>>,
                      cx: &mut Context<'a>,
                      remaining_deps: &mut BinaryHeap<DepsFrame>,
                      parent: &mut Rc<Summary>,
                      cur: &mut usize,
                      dep: &mut Dependency,
                      features: &mut Vec<String>) -> Option<Candidate> {
    while let Some(mut frame) = backtrack_stack.pop() {
        if let Some((_, candidate)) = frame.remaining_candidates.next() {
            *cx = frame.context_backup.clone();
            *remaining_deps = frame.deps_backup.clone();
            *parent = frame.parent.clone();
            *cur = remaining_deps.peek().unwrap().remaining_siblings.cur_index();
            *dep = frame.dep.clone();
            *features = frame.features.clone();
            backtrack_stack.push(frame);
            return Some(candidate)
        }
    }
    None
}
fn find_candidate < ' a > ( backtrack_stack : & mut Vec < BacktrackFrame < ' a > > , cx : & mut Context < ' a > , remaining_deps : & mut BinaryHeap < DepsFrame > , parent : & mut Rc < Summary > , cur : & mut usize , dep : & mut Dependency , features : & mut Vec < String > ) -> Option < Candidate > { while let Some ( mut frame ) = backtrack_stack . pop ( ) { if let Some ( ( _ , candidate ) ) = frame . remaining_candidates . next ( ) { * cx = frame . context_backup . clone ( ) ; * remaining_deps = frame . deps_backup . clone ( ) ; * parent = frame . parent . clone ( ) ; * cur = remaining_deps . peek ( ) . unwrap ( ) . remaining_siblings . cur_index ( ) ; * dep = frame . dep . clone ( ) ; * features = frame . features . clone ( ) ; backtrack_stack . push ( frame ) ; return Some ( candidate ) } } None }
Searches up `backtrack_stack` until it finds a dependency with remaining
candidates.
Searches up ` backtrack_stack ` until it finds a dependency with remaining candidates .
backtrack_stack
&mut Vec<BacktrackFrame<'a>>
cx
&mut Context<'a>
remaining_deps
&mut BinaryHeap<DepsFrame>
parent
&mut Rc<Summary>
cur
&mut usize
dep
&mut Dependency
features
&mut Vec<String>
backtrack_stack
&mut Vec<BacktrackFrame<'a>>
cx
&mut Context<'a>
remaining_deps
&mut BinaryHeap<DepsFrame>
parent
&mut Rc<Summary>
cur
&mut usize
dep
&mut Dependency
features
&mut Vec<String>