Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider disallowing root nesting #2651

Open
jplatte opened this issue Mar 14, 2024 · 7 comments
Open

Consider disallowing root nesting #2651

jplatte opened this issue Mar 14, 2024 · 7 comments
Labels
A-axum breaking change A PR that makes a breaking change. T-release Topic: releases
Milestone

Comments

@jplatte
Copy link
Member

jplatte commented Mar 14, 2024

Before the 0.8.0 release, I would like to come back to nest("/", router) and nest_service("/", svc). I believe I suggested disallowing them (in favor of merge and fallback_service) before, but if so there must have been some pushback by David since we still allow both.

Any pointers or thoughts appreciated.

@jplatte jplatte added A-axum breaking change A PR that makes a breaking change. T-release Topic: releases labels Mar 14, 2024
@jplatte jplatte added this to the 0.8 milestone Mar 14, 2024
@jplatte
Copy link
Member Author

jplatte commented Mar 17, 2024

The only thing I found is this: #2012
… which suggests I'm wrong about previous push-back and we should just disallow root nesting :)

@dancixx
Copy link

dancixx commented Sep 9, 2024

@jplatte are you planning to deprecate the nest function or just improve it? This is very handy and makes the code much readable.

@jplatte
Copy link
Member Author

jplatte commented Sep 9, 2024

@dancixx This issue is specifically about nest and nest_service calls where the path (first argument) is /.

@dancixx
Copy link

dancixx commented Sep 9, 2024

@dancixx This issue is specifically about nest and nest_service calls where the path (first argument) is /.

@jplatte yes Im talking about this: Route::new().nest("/", Router::new()...). But if this issue is not about deprecating this feature rather then just make it more conveniently; never mind.

@jplatte
Copy link
Member Author

jplatte commented Sep 9, 2024

Is there any reason you use that rather than Router::merge?

@dancixx
Copy link

dancixx commented Sep 9, 2024

@jplatte I don't have any specific reason I'm just more familiar with the nest function. Actually, I started a new project using nest and I have found this issue and I don't want to use deprecated features, that was main the reason why I asked it.

@jplatte
Copy link
Member Author

jplatte commented Sep 9, 2024

Yeah, I would recommend using merge(...) instead of nest("/", ...) then :)
It should be equivalent in functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum breaking change A PR that makes a breaking change. T-release Topic: releases
Projects
None yet
Development

No branches or pull requests

2 participants