Replies: 1 comment 3 replies
-
People accidentally using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there! Opening a discussion because I'm not sure this is really an actionable issue, but just wanted to point it out as a potential hazard for others / something that could potentially be prevented with additional types.
In Axum 0.5, we had the following code:
In Axum 0.6, the
nest
method no longer acceptsget_service
, which is aMethodRouter
. I switched toroute
, because that's the first thing I saw that took aMethodRouter
:However, this leads to incorrect behaviour - the routing is wrong, and things will not behave as expected. The correct solution is to use
nest_service
:but I hadn't realised this until it broke. Would it be possible to more meaningfully disambiguate these so that you're "led" to the more correct solution by the type system? Of course, services can be arbitrary things so the additional flexibility probably makes sense - but I've personally found the
route
/nest[_service]
distinction to be confusing in other contexts, too.Beta Was this translation helpful? Give feedback.
All reactions