1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 09:59:21 +02:00

Allow to use path without traling slashes for scope registration #241

This commit is contained in:
Nikolay Kim
2018-05-23 13:21:29 -07:00
parent 72757887c9
commit 68eb2f26c9
11 changed files with 107 additions and 59 deletions

View File

@ -374,9 +374,7 @@ fn test_scope_and_path_extractor() {
App::new().scope("/sc", |scope| {
scope.resource("/{num}/index.html", |r| {
r.route()
.with(|p: Path<(usize,)>| {
format!("Welcome {}!", p.0)
})
.with(|p: Path<(usize,)>| format!("Welcome {}!", p.0))
})
})
});
@ -410,10 +408,9 @@ fn test_nested_scope_and_path_extractor() {
App::new().scope("/sc", |scope| {
scope.nested("/{num}", |scope| {
scope.resource("/{num}/index.html", |r| {
r.route()
.with(|p: Path<(usize, usize)>| {
format!("Welcome {} {}!", p.0, p.1)
})
r.route().with(|p: Path<(usize, usize)>| {
format!("Welcome {} {}!", p.0, p.1)
})
})
})
})