Skip to content

Commit 45ff1d5

Browse files
committed
Move to stable rust
1 parent 806338f commit 45ff1d5

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ license = "MIT"
55
repository = "https://github.com/conduit-rust/route-recognizer.rs"
66
keywords = ["router", "url"]
77

8-
version = "0.1.10"
8+
version = "0.1.11"
99
authors = ["wycats"]

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(core)]
21
#![cfg_attr(test, feature(test))]
32

43
#[cfg(test)] extern crate test;

src/nfa.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,15 @@ impl<T> NFA<T> {
232232
self.get(thread.state).acceptance
233233
});
234234

235-
let thread = returned.max_by(|thread| ord(thread.state));
235+
let thread = returned.fold(None, |prev, y| {
236+
let y_v = ord(y.state);
237+
match prev {
238+
None => Some((y_v, y)),
239+
Some((x_v, x)) => {
240+
if x_v < y_v {Some((y_v, y))} else {Some((x_v, x))}
241+
}
242+
}
243+
}).map(|p| p.1);
236244

237245
match thread {
238246
None => Err("The string was exhausted before reaching an \

0 commit comments

Comments
 (0)