mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove as_slice() calls from script.
This commit is contained in:
parent
ef536372cd
commit
a862479ca8
42 changed files with 115 additions and 124 deletions
|
@ -20,7 +20,7 @@ impl UrlHelper {
|
|||
pub fn Search(url: &Url) -> USVString {
|
||||
USVString(match url.query {
|
||||
None => "".to_owned(),
|
||||
Some(ref query) if query.as_slice() == "" => "".to_owned(),
|
||||
Some(ref query) if query.is_empty() => "".to_owned(),
|
||||
Some(ref query) => format!("?{}", query)
|
||||
})
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ impl UrlHelper {
|
|||
pub fn Hash(url: &Url) -> USVString {
|
||||
USVString(match url.fragment {
|
||||
None => "".to_owned(),
|
||||
Some(ref hash) if hash.as_slice() == "" => "".to_owned(),
|
||||
Some(ref hash) if hash.is_empty() => "".to_owned(),
|
||||
Some(ref hash) => format!("#{}", hash)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue