diff --git a/router/CHANGES.txt b/router/CHANGES.txt index 9944a14f..558baeb9 100644 --- a/router/CHANGES.txt +++ b/router/CHANGES.txt @@ -1,5 +1,9 @@ # Changes +## [0.2.3] - 2019-12-25 + +* Add impl `IntoPattern` for `&String` + ## [0.2.2] - 2019-12-25 * Use `IntoPattern` for `RouterBuilder::path()` diff --git a/router/Cargo.toml b/router/Cargo.toml index 8aba0050..419ae5ea 100644 --- a/router/Cargo.toml +++ b/router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-router" -version = "0.2.2" +version = "0.2.3" authors = ["Nikolay Kim "] description = "Path router" keywords = ["actix"] diff --git a/router/src/lib.rs b/router/src/lib.rs index 21984404..7e41c4c3 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -53,6 +53,16 @@ impl IntoPattern for String { } } +impl<'a> IntoPattern for &'a String { + fn is_single(&self) -> bool { + true + } + + fn patterns(&self) -> Vec { + vec![self.as_str().to_string()] + } +} + impl<'a> IntoPattern for &'a str { fn is_single(&self) -> bool { true