1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 00:01:11 +01:00

Add impl IntoPattern for &String

This commit is contained in:
Nikolay Kim 2019-12-25 21:34:14 +04:00
parent 59c5e9be6a
commit e21c58930b
3 changed files with 15 additions and 1 deletions

View File

@ -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()`

View File

@ -1,6 +1,6 @@
[package]
name = "actix-router"
version = "0.2.2"
version = "0.2.3"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Path router"
keywords = ["actix"]

View File

@ -53,6 +53,16 @@ impl IntoPattern for String {
}
}
impl<'a> IntoPattern for &'a String {
fn is_single(&self) -> bool {
true
}
fn patterns(&self) -> Vec<String> {
vec![self.as_str().to_string()]
}
}
impl<'a> IntoPattern for &'a str {
fn is_single(&self) -> bool {
true