mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Make ServoUrl::as_url return a &Url
This commit is contained in:
parent
fb2c9e7bf5
commit
bba0be13dd
7 changed files with 19 additions and 19 deletions
|
@ -12,37 +12,37 @@ pub struct UrlHelper;
|
|||
|
||||
impl UrlHelper {
|
||||
pub fn Origin(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::origin(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::origin(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Href(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::href(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::href(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Hash(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::hash(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::hash(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Host(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::host(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::host(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Port(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::port(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::port(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Search(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::search(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::search(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Hostname(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::hostname(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::hostname(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Password(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::password(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::password(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Pathname(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::pathname(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::pathname(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Protocol(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::protocol(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::protocol(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn Username(url: &ServoUrl) -> USVString {
|
||||
USVString(quirks::username(url.as_url().unwrap()).to_owned())
|
||||
USVString(quirks::username(url.as_url()).to_owned())
|
||||
}
|
||||
pub fn SetHash(url: &mut ServoUrl, value: USVString) {
|
||||
if let Some(ref mut url) = url.as_mut_url() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue