1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-12-18 02:13:58 +01:00

prepare router 0.2.5 release (#198)

This commit is contained in:
Rob Ede 2020-09-21 22:46:59 +01:00 committed by GitHub
parent e5ca271764
commit 6c65e2a79f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 25 deletions

View File

@ -2,56 +2,54 @@
## Unreleased - 2020-xx-xx
## 0.2.5 - 2020-09-20
* Fix `from_hex()` method
## [0.2.4] - 2019-12-31
## 0.2.4 - 2019-12-31
* Add `ResourceDef::resource_path_named()` path generation method
## [0.2.3] - 2019-12-25
## 0.2.3 - 2019-12-25
* Add impl `IntoPattern` for `&String`
## [0.2.2] - 2019-12-25
## 0.2.2 - 2019-12-25
* Use `IntoPattern` for `RouterBuilder::path()`
## [0.2.1] - 2019-12-25
## 0.2.1 - 2019-12-25
* Add `IntoPattern` trait
* Add multi-pattern resources
## [0.2.0] - 2019-12-07
## 0.2.0 - 2019-12-07
* Update http to 0.2
* Update regex to 1.3
* Use bytestring instead of string
## [0.1.5] - 2019-05-15
## 0.1.5 - 2019-05-15
* Remove debug prints
## [0.1.4] - 2019-05-15
## 0.1.4 - 2019-05-15
* Fix checked resource match
## [0.1.3] - 2019-04-22
## 0.1.3 - 2019-04-22
* Added support for `remainder match` (i.e "/path/{tail}*")
## [0.1.2] - 2019-04-07
## 0.1.2 - 2019-04-07
* Export `Quoter` type
* Allow to reset `Path` instance
## [0.1.1] - 2019-04-03
## 0.1.1 - 2019-04-03
* Get dynamic segment by name instead of iterator.
## [0.1.0] - 2019-03-09
## 0.1.0 - 2019-03-09
* Initial release

View File

@ -1,8 +1,8 @@
[package]
name = "actix-router"
version = "0.2.4"
version = "0.2.5"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Path router"
description = "Resource path matching library"
keywords = ["actix"]
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-net.git"
@ -22,7 +22,7 @@ regex = "1.3.1"
serde = "1.0.104"
bytestring = "0.1.2"
log = "0.4.8"
http = { version="0.2.0", optional=true }
http = { version = "0.2.0", optional = true }
[dev-dependencies]
http = "0.2.0"

View File

@ -161,9 +161,7 @@ impl<'de, T: ResourcePath + 'de> Deserializer<'de> for PathDeserializer<'de, T>
V: Visitor<'de>,
{
if self.path.is_empty() {
Err(de::value::Error::custom(
"expeceted at least one parameters",
))
Err(de::value::Error::custom("expected at least one parameters"))
} else {
visitor.visit_enum(ValueEnum {
value: &self.path[0],

View File

@ -1,4 +1,5 @@
//! Resource path matching library.
mod de;
mod path;
mod resource;

View File

@ -155,7 +155,7 @@ impl ResourceDef {
}
#[inline]
/// Check if path matchs this pattern?
/// Check if path matches this pattern.
pub fn is_match(&self, path: &str) -> bool {
match self.tp {
PatternType::Static(ref s) => s == path,
@ -165,7 +165,7 @@ impl ResourceDef {
}
}
/// Is prefix path a match against this resource?
/// Is prefix path a match against this resource.
pub fn is_prefix_match(&self, path: &str) -> Option<usize> {
let plen = path.len();
let path = if path.is_empty() { "/" } else { path };
@ -240,7 +240,7 @@ impl ResourceDef {
}
}
/// Is the given path and parameters a match against this pattern?
/// Is the given path and parameters a match against this pattern.
pub fn match_path<T: ResourcePath>(&self, path: &mut Path<T>) -> bool {
match self.tp {
PatternType::Static(ref s) => {
@ -875,7 +875,7 @@ mod tests {
}
#[test]
fn test_reousrce_prefix_dynamic() {
fn test_resource_prefix_dynamic() {
let re = ResourceDef::prefix("/{name}/");
assert!(re.is_match("/name/"));
assert!(re.is_match("/name/gs"));