mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -50,7 +50,7 @@ impl TextEncoder {
|
|||
// https://encoding.spec.whatwg.org/#dom-textencoder
|
||||
pub fn Constructor(global: GlobalRef,
|
||||
label: DOMString) -> Fallible<Temporary<TextEncoder>> {
|
||||
let encoding = match encoding_from_whatwg_label(label.trim().as_slice().to_ascii_lowercase().as_slice()) {
|
||||
let encoding = match encoding_from_whatwg_label(&label.trim().to_ascii_lowercase()) {
|
||||
Some(enc) => enc,
|
||||
None => {
|
||||
debug!("Encoding Label Not Supported");
|
||||
|
@ -80,7 +80,7 @@ impl<'a> TextEncoderMethods for JSRef<'a, TextEncoder> {
|
|||
#[allow(unsafe_code)]
|
||||
fn Encode(self, cx: *mut JSContext, input: USVString) -> *mut JSObject {
|
||||
unsafe {
|
||||
let output = self.encoder.encode(input.0.as_slice(), EncoderTrap::Strict).unwrap();
|
||||
let output = self.encoder.encode(&input.0, EncoderTrap::Strict).unwrap();
|
||||
let length = output.len() as u32;
|
||||
let js_object: *mut JSObject = JS_NewUint8Array(cx, length);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue