Skip to content

Commit

Permalink
Merge pull request #117 from tigerros/master
Browse files Browse the repository at this point in the history
Change `CatchAll` segment definition to `:..x` from `:...x`
  • Loading branch information
ealmloff authored Sep 11, 2023
2 parents 0c5339a + 2e4ee3b commit e535eac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs-src/0.4/en/reference/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ enum Route {
enum Route {
#[route("/home")]
// if the current location doesn't match any of the above routes, redirect to "/home"
#[redirect("/:...segments", |segments: Vec<String>| Route::Home {})]
#[redirect("/:..segments", |segments: Vec<String>| Route::Home {})]
Home {}
#[route("/blog")]
Blog {}
Expand Down
2 changes: 1 addition & 1 deletion docs-src/0.4/en/router/reference/routes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The segment can be of any type that implements `FromStr`.

## Catch All Segments

Catch All segments are in the form of `:...name` where `name` is the name of the field in the route variant. If the segments are parsed successfully then the route matches, otherwise the matching continues.
Catch All segments are in the form of `:..name` where `name` is the name of the field in the route variant. If the segments are parsed successfully then the route matches, otherwise the matching continues.

The segment can be of any type that implements `FromSegments`. (Vec<String> implements this by default)

Expand Down
2 changes: 1 addition & 1 deletion src/doc_examples/catch_all_segments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use dioxus_router::prelude::*;
#[derive(Routable, Clone)]
#[rustfmt::skip]
enum Route {
// segments that start with :... are catch all segments
// segments that start with :.. are catch all segments
#[route("/blog/:..segments")]
BlogPost {
// You must include catch all segment in child variants
Expand Down

0 comments on commit e535eac

Please sign in to comment.