diff --git a/src/recognizer.rs b/src/recognizer.rs index 4b08aaece..2ee596794 100644 --- a/src/recognizer.rs +++ b/src/recognizer.rs @@ -395,11 +395,11 @@ mod tests { let mut rec = RouteRecognizer::::default(); let routes = vec![ - ("/name", 1), - ("/name/{val}", 2), - ("/name/{val}/index.html", 3), - ("/v{val}/{val2}/index.html", 4), - ("/v/{tail:.*}", 5), + ("/name", None, 1), + ("/name/{val}", None, 2), + ("/name/{val}/index.html", None, 3), + ("/v{val}/{val2}/index.html", None, 4), + ("/v/{tail:.*}", None, 5), ]; rec.set_routes(routes); @@ -434,7 +434,7 @@ mod tests { } fn assert_parse(pattern: &str, expected_re: &str) -> Regex { - let re_str = parse(pattern); + let (re_str, _) = parse(pattern); assert_eq!(&*re_str, expected_re); Regex::new(&re_str).unwrap() } diff --git a/tests/test_httprequest.rs b/tests/test_httprequest.rs index e69ee9249..794864cd0 100644 --- a/tests/test_httprequest.rs +++ b/tests/test_httprequest.rs @@ -92,7 +92,7 @@ fn test_request_match_info() { let mut req = HttpRequest::new(Method::GET, Uri::from_str("/value/?id=test").unwrap(), Version::HTTP_11, HeaderMap::new(), Payload::empty()); - let rec = RouteRecognizer::new("/".to_owned(), vec![("/{key}/".to_owned(), 1)]); + let rec = RouteRecognizer::new("/".to_owned(), vec![("/{key}/".to_owned(), None, 1)]); let (params, _) = rec.recognize(req.path()).unwrap(); let params = params.unwrap();