Skip to content

Commit

Permalink
Merge pull request #1 from sfackler/master
Browse files Browse the repository at this point in the history
Fix for upstream changes
  • Loading branch information
alexcrichton committed Dec 15, 2014
2 parents 15f2528 + f542e78 commit f55edf3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,9 @@ impl<'a> Parser<'a> {
// Otherwise, an error will be returned.
// Generally, `allow_start` is only true when you're *not* expecting an
// opening parenthesis.
fn pos_last(&self, allow_start: bool, pred: |&BuildAst| -> bool)
-> Result<uint, Error> {
fn pos_last<F>(&self, allow_start: bool, pred: F)
-> Result<uint, Error>
where F: Fn(&BuildAst) -> bool {
let from = match self.stack.iter().rev().position(pred) {
Some(i) => i,
None => {
Expand Down Expand Up @@ -1029,7 +1030,7 @@ fn is_valid_cap(c: char) -> bool {

fn find_class(classes: NamedClasses, name: &str) -> Option<Vec<(char, char)>> {
match classes.binary_search(|&(s, _)| s.cmp(name)) {
BinarySearchResult::Found(i) => Some(classes[i].val1().to_vec()),
BinarySearchResult::Found(i) => Some(classes[i].1.to_vec()),
BinarySearchResult::NotFound(_) => None,
}
}
Expand Down

0 comments on commit f55edf3

Please sign in to comment.