mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove some unnecessary uses of as_slice
For the majority of these cases, `as_slice` can be removed due to `Deref`. In particular, `Deref` for: * `String` -> `str` * `Atom` -> `str` The latter of those two requires, a bump of the locked `string-cache` library
This commit is contained in:
parent
b8ea10bfe3
commit
d838fcce30
19 changed files with 98 additions and 102 deletions
|
@ -218,8 +218,7 @@ impl Window {
|
|||
}
|
||||
|
||||
// http://www.whatwg.org/html/#atob
|
||||
pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> {
|
||||
let input = btoa.as_slice();
|
||||
pub fn base64_btoa(input: DOMString) -> Fallible<DOMString> {
|
||||
// "The btoa() method must throw an InvalidCharacterError exception if
|
||||
// the method's first argument contains any character whose code point
|
||||
// is greater than U+00FF."
|
||||
|
@ -239,10 +238,7 @@ pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> {
|
|||
}
|
||||
|
||||
// http://www.whatwg.org/html/#atob
|
||||
pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
|
||||
// "Let input be the string being parsed."
|
||||
let input = atob.as_slice();
|
||||
|
||||
pub fn base64_atob(input: DOMString) -> Fallible<DOMString> {
|
||||
// "Remove all space characters from input."
|
||||
// serialize::base64::from_base64 ignores \r and \n,
|
||||
// but it treats the other space characters as
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue