Skip to content

FromStr impl for extra::url::Url drops the last digit of port #8612

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

Closed
sfackler opened this issue Aug 19, 2013 · 0 comments
Closed

FromStr impl for extra::url::Url drops the last digit of port #8612

sfackler opened this issue Aug 19, 2013 · 0 comments

Comments

@sfackler
Copy link
Member

This program

extern mod extra;

use extra::url::Url;

fn main() {
    printfln!(FromStr::from_str::<Url>("scheme://host:1234"));
}

outputs

Some({scheme: ~"scheme", user: None, host: ~"host", port: Some(~"123"), path: ~"", query: ~[], fragment: None})
lilyball added a commit to lilyball/rust that referenced this issue Aug 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 7, 2022
…ked-in-const, r=flip1995

Suggest from_utf8_unchecked in const contexts

Unfortunately I couldn't figure out how to check whether a given expression is in an `unsafe` context or not, so I just unconditionally emit the wrapping `unsafe {}` block in the suggestion. If there is an easy way to get it to work better then I would love to hear it.

changelog: Suggest `from_utf8_unchecked` instead of `from_utf8` in const contexts for ``[`transmute_bytes_to_str`]``

refs: rust-lang#8379
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

No branches or pull requests

1 participant