From 9fc5bd7f203c16227236a5fe4f3aa9165fe685ce Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 20 Oct 2021 09:33:38 +0200 Subject: [PATCH 1/2] Remove broken test --- src/lib.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index eb7c957..19bf6b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -554,21 +554,4 @@ mod tests { let m = router.recognize("/4.static.static"); assert!(m.is_err()); } - - #[test] - fn test_string_encoding() { - let mut router = Router::new(); - router.add("/foo%2Fbar", "Hello".to_string()); - router.add("/foo bar", "Hello".to_string()); - - // assert_eq!( - // router.recognize("/foo%2fbar").unwrap().handler().as_str(), - // "Hello" - // ); - - assert_eq!( - router.recognize("/foo%20bar").unwrap().handler().as_str(), - "Hello" - ); - } } From d892b7d8bce97f6d3432dac39349a37595691b2a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 20 Oct 2021 10:03:26 +0200 Subject: [PATCH 2/2] Fix `panic!(format!())` warning --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 19bf6b8..ad0463e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,7 +142,7 @@ impl Index<&str> for Params { type Output = String; fn index(&self, index: &str) -> &String { match self.map.get(index) { - None => panic!(format!("params[{}] did not exist", index)), + None => panic!("params[{}] did not exist", index), Some(s) => s, } }