Optional API to convert to http::Uri

Open
#824 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

Start by locating the crate's feature definitions and the public URL conversion APIs, then review how an optional http dependency could expose conversion to http::Uri. Check the http::Uri constructors and existing URL tests; done means the feature-gated API converts supported url::Url values without an intermediate string parse and is covered by tests.

Written by the indexing model from the issue text.

Description

enhancement
Rationale

The simplest way to convert from a url::Url to a http::Uri currently is to turn it into a string and then parse it again. It would be helpful if there was an API to do this conversion directly, instead of necessitating another round of parsing

Proposal

With a feature flag called http, the dependency http can be added.
When the http feature is active, a function can be exposed which does the conversion from url's internal structure to that of http::Uri's.

Dominant language
Rust
Stars
1.6k
Forks
406
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from servo/rust-url

All issues in servo/rust-url

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.