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

Please could you export SchemeType or add is_special() method to Url #800

Closed
samuelcolvin opened this issue Nov 2, 2022 · 1 comment · Fixed by #826
Closed

Please could you export SchemeType or add is_special() method to Url #800

samuelcolvin opened this issue Nov 2, 2022 · 1 comment · Fixed by #826

Comments

@samuelcolvin
Copy link

Currently there's no way to check if a url/scheme is "special" without duplicating logic from

rust-url/url/src/parser.rs

Lines 161 to 167 in 1c1e406

pub fn from(s: &str) -> Self {
match s {
"http" | "https" | "ws" | "wss" | "ftp" => SchemeType::SpecialNotFile,
"file" => SchemeType::File,
_ => SchemeType::NotSpecial,
}
}

Would be great if this could be made public, or an is_special method added to Url.

Also, I guess SchemeType::from should probably be implemented via the Into trait?

@qsantos qsantos mentioned this issue Mar 16, 2023
@qsantos
Copy link
Contributor

qsantos commented Mar 16, 2023

See #826

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