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:
parent
59c5e9be6a
commit
e21c58930b
@ -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()`
|
||||
|
@ -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"]
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user