Skip to content

Commit

Permalink
fixed the 'as_slice' deprecated warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wafflespeanut committed Sep 25, 2015
1 parent e04c2c7 commit 35d7ced
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions components/script/dom/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use script_task::ScriptTaskEventCategory::WebSocketEvent;
use script_task::{CommonScriptMsg, Runnable};
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
use std::ptr;
use std::sync::{Arc, Mutex};
use std::{ptr, slice};
use util::str::DOMString;
use util::task::spawn_named;
use websocket::client::receiver::Receiver;
Expand Down Expand Up @@ -139,7 +139,9 @@ impl WebSocket {
// Step 3: Potentially block access to some ports.

// Step 4.
let protocols = protocols.as_slice();
let protocols: &[DOMString] = protocols
.as_ref()
.map_or(&[], |ref string| slice::ref_slice(string));

// Step 5.
for (i, protocol) in protocols.iter().enumerate() {
Expand All @@ -151,7 +153,6 @@ impl WebSocket {

if protocols[i + 1..].iter().any(|p| p == protocol) {
return Err(Syntax);

}

if protocol.chars().any(|c| c < '\u{0021}' || c > '\u{007E}') {
Expand Down
1 change: 0 additions & 1 deletion components/script/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#![feature(ascii)]
#![feature(as_slice)]
#![feature(as_unsafe_cell)]
#![feature(borrow_state)]
#![feature(box_syntax)]
Expand Down

0 comments on commit 35d7ced

Please sign in to comment.