Router struct implements Clone trait

This commit is contained in:
Nikolay Kim 2020-10-28 17:16:08 +06:00
parent 1e8f58db4a
commit d1f8ac107b
4 changed files with 9 additions and 4 deletions

View file

@ -1,5 +1,9 @@
# Changes
## [0.3.8] - 2020-10-28
* Router struct implements Clone trait
## [0.3.7] - 2020-09-21
* Fix hex conversion helper

View file

@ -1,6 +1,6 @@
[package]
name = "ntex-router"
version = "0.3.7"
version = "0.3.8"
authors = ["ntex contributors <team@ntex.rs>"]
description = "Path router"
keywords = ["ntex"]
@ -17,8 +17,8 @@ path = "src/lib.rs"
default = ["http"]
[dependencies]
regex = "1.3.5"
serde = "1.0.105"
regex = "1.4.1"
serde = "1.0.116"
bytestring = "0.1.5"
log = "0.4.8"
http = { version = "0.2.1", optional = true }

View file

@ -11,6 +11,7 @@ pub struct ResourceInfo {
}
/// Resource router.
#[derive(Clone)]
pub struct Router<T, U = ()> {
tree: Tree,
resources: Vec<(ResourceDef, T, Option<U>)>,

View file

@ -5,7 +5,7 @@ use super::path::PathItem;
use super::resource::{ResourceDef, Segment};
use super::{Resource, ResourcePath};
#[derive(Debug)]
#[derive(Debug, Clone)]
pub(super) struct Tree {
key: Vec<Segment>,
value: Vec<Value>,