Skip to content

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

@samuelcolvin

Description

@samuelcolvin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions