Consider adding TryFrom<&Uri> for Query #2048
Labels
A-axum
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
E-easy
Call for participation: Experience needed to fix: Easy / not much
E-help-wanted
Call for participation: Help is requested to fix this issue.
Feature Request
Consider adding
impl TryFrom<&Uri> for axum::extract::Query
Motivation
I was porting a project from
rocket
andaxum
and accidentally regressed some endpoints from differences in query parsing. It would have been nice to have a simple way to test the query parsing in isolation, but the simplest solution I could come up with was to just copy the internals ofQuery
'sFromRequestParts
Proposal
Move the logic from
Query
'sFromRequestParts
implementation intoTryFrom<&Uri> for Query
and callQuery::try_from(&parts.uri)
infrom_request_parts()
Only drawback I can think of is that this adds some slight noise to the API
Alternatives
None that seem compelling
The text was updated successfully, but these errors were encountered: