-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
I noticed hyper::Uri
doesn't have any setter methods. It seems the only way to construct one is to parse it from a string or use Default
.
I have a function that takes a Uri
which is expected to have a scheme and authority, and adds path/query/fragment information to it. Currently, I'd have to do this by converting the input Uri
to a string, manipulating it as a string, and then re-parsing it to a Uri
. This seems error prone and involves fallible conversions, but if I was able to use a signature like this:
fn add_path_to_uri(uri: &mut Uri)
Then I'd be able to do statically-verifiable in-place modifications, like you can with the Url
type from the url
crate.
Would it be possible to add setters to the Uri
type, or is there a reason it's so opaque?
Metadata
Metadata
Assignees
Labels
No labels