File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ license = "MIT"
5
5
repository = " https://github.com/conduit-rust/route-recognizer.rs"
6
6
keywords = [" router" , " url" ]
7
7
8
- version = " 0.1.10 "
8
+ version = " 0.1.11 "
9
9
authors = [" wycats" ]
Original file line number Diff line number Diff line change 1
- #![ feature( core) ]
2
1
#![ cfg_attr( test, feature( test) ) ]
3
2
4
3
#[ cfg( test) ] extern crate test;
Original file line number Diff line number Diff line change @@ -232,7 +232,15 @@ impl<T> NFA<T> {
232
232
self . get ( thread. state ) . acceptance
233
233
} ) ;
234
234
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 ) ;
236
244
237
245
match thread {
238
246
None => Err ( "The string was exhausted before reaching an \
You can’t perform that action at this time.
0 commit comments