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

[extra::url] Support URL with non-relative schemes #10705

Closed
SimonSapin opened this issue Nov 28, 2013 · 0 comments · Fixed by #16076
Closed

[extra::url] Support URL with non-relative schemes #10705

SimonSapin opened this issue Nov 28, 2013 · 0 comments · Fixed by #16076

Comments

@SimonSapin
Copy link
Contributor

The current implementation of the Url struct looks like this:

pub struct Url {
    scheme: ~str,
    user: Option<UserInfo>,
    host: ~str,
    port: Option<~str>,
    path: ~str,
    query: Query,
    fragment: Option<~str>
}

It always has user, host, port, path and query fields, but those only exist for URLs with a relative scheme such as mailto or data. The data structure should be something like this:

pub struct Url {
    scheme: ~str,
    scheme_data: SchemeData,
    fragment: Option<~str>
}

pub enum SchemeData {
    RelativeSchemeData(RelativeSchemeData),
    OtherSchemeData(~str),
}

pub struct RelativeSchemeData {
    user: Option<UserInfo>,
    host: ~str,
    port: Option<~str>,
    path: ~str,
    query: Query,
}
@aturon aturon added the A-libs label Jun 3, 2014
SimonSapin added a commit to SimonSapin/rust that referenced this issue Jul 30, 2014
The replacement is [rust-url](https://github.com/servo/rust-url),
which can be used with Cargo.

Fix rust-lang#15874
Fix rust-lang#10707
Close rust-lang#10706
Close rust-lang#10705
Close rust-lang#8486
bors added a commit that referenced this issue Jul 31, 2014
The replacement is [rust-url](https://github.com/servo/rust-url), which can be used with Cargo.

Fix #15874
Fix #10707
Close #10706
Close #10705
Close #8486
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
Add a test that checks for old style test headers

Follow up to rust-lang#10669, we're pretty used to them so they're easy to slip through

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants