Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Dec 16, 2023
1 parent 18b9ac6 commit 79514de
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
15 changes: 11 additions & 4 deletions integrations/actix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,14 @@ pub fn generate_route_list_with_exclusions_and_ssg<IV>(
app_fn: impl Fn() -> IV + 'static + Clone,
excluded_routes: Option<Vec<String>>,
) -> (Vec<RouteListing>, StaticDataMap)
where
IV: IntoView + 'static,
where
IV: IntoView + 'static,
{
generate_route_list_with_exclusions_and_ssg_and_context(app_fn, excluded_routes, || {})
generate_route_list_with_exclusions_and_ssg_and_context(
app_fn,
excluded_routes,
|| {},
)
}

/// Generates a list of all routes defined in Leptos's Router in your app. We can then use this to automatically
Expand All @@ -943,7 +947,10 @@ where
IV: IntoView + 'static,
{
let (mut routes, static_data_map) =
leptos_router::generate_route_list_inner_with_context(app_fn, additional_context);
leptos_router::generate_route_list_inner_with_context(
app_fn,
additional_context,
);

// Actix's Router doesn't follow Leptos's
// Match `*` or `*someword` to replace with replace it with "/{tail.*}
Expand Down
15 changes: 11 additions & 4 deletions integrations/axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,10 +1364,14 @@ pub fn generate_route_list_with_exclusions_and_ssg<IV>(
app_fn: impl Fn() -> IV + 'static + Clone,
excluded_routes: Option<Vec<String>>,
) -> (Vec<RouteListing>, StaticDataMap)
where
IV: IntoView + 'static,
where
IV: IntoView + 'static,
{
generate_route_list_with_exclusions_and_ssg_and_context(app_fn, excluded_routes, || {})
generate_route_list_with_exclusions_and_ssg_and_context(
app_fn,
excluded_routes,
|| {},
)
}

/// Generates a list of all routes defined in Leptos's Router in your app. We can then use this to automatically
Expand All @@ -1385,7 +1389,10 @@ where
IV: IntoView + 'static,
{
let (routes, static_data_map) =
leptos_router::generate_route_list_inner_with_context(app_fn, additional_context);
leptos_router::generate_route_list_inner_with_context(
app_fn,
additional_context,
);
// Axum's Router defines Root routes as "/" not ""
let mut routes = routes
.into_iter()
Expand Down
15 changes: 11 additions & 4 deletions integrations/viz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,10 +1035,14 @@ pub fn generate_route_list_with_exclusions_and_ssg<IV>(
app_fn: impl Fn() -> IV + 'static + Clone,
excluded_routes: Option<Vec<String>>,
) -> (Vec<RouteListing>, StaticDataMap)
where
IV: IntoView + 'static,
where
IV: IntoView + 'static,
{
generate_route_list_with_exclusions_and_ssg_and_context(app_fn, excluded_routes, || {})
generate_route_list_with_exclusions_and_ssg_and_context(
app_fn,
excluded_routes,
|| {},
)
}

/// Generates a list of all routes defined in Leptos's Router in your app. We can then use this to automatically
Expand All @@ -1054,7 +1058,10 @@ where
IV: IntoView + 'static,
{
let (routes, static_data_map) =
leptos_router::generate_route_list_inner_with_context(app_fn, additional_context);
leptos_router::generate_route_list_inner_with_context(
app_fn,
additional_context,
);
// Viz's Router defines Root routes as "/" not ""
let mut routes = routes
.into_iter()
Expand Down
6 changes: 3 additions & 3 deletions router/src/extract_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ impl RouteListing {
pub fn generate_route_list_inner<IV>(
app_fn: impl Fn() -> IV + 'static + Clone,
) -> (Vec<RouteListing>, StaticDataMap)
where
IV: IntoView + 'static,
where
IV: IntoView + 'static,
{
generate_route_list_inner_with_context(app_fn, ||{})
generate_route_list_inner_with_context(app_fn, || {})
}
/// Generates a list of all routes this application could possibly serve. This returns the raw routes in the leptos_router
/// format. Odds are you want `generate_route_list()` from either the [`actix`], [`axum`], or [`viz`] integrations if you want
Expand Down

0 comments on commit 79514de

Please sign in to comment.