aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/bindings/str.rs7
-rw-r--r--tests/unit/script/dom/bindings.rs17
-rw-r--r--tests/unit/script/lib.rs1
3 files changed, 0 insertions, 25 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index 3ee685fbe02..69565520899 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -8,7 +8,6 @@ use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::fmt;
use std::hash::{Hash, Hasher};
-use std::mem;
use std::ops;
use std::ops::{Deref, DerefMut};
use std::str;
@@ -31,12 +30,6 @@ impl ByteString {
str::from_utf8(&self.0).ok()
}
- /// Returns ownership of the underlying Vec<u8> and copies an empty
- /// vec in its place
- pub fn bytes(&mut self) -> Vec<u8> {
- mem::replace(&mut self.0, Vec::new())
- }
-
/// Returns the length.
pub fn len(&self) -> usize {
self.0.len()
diff --git a/tests/unit/script/dom/bindings.rs b/tests/unit/script/dom/bindings.rs
deleted file mode 100644
index 7dfb308e1ed..00000000000
--- a/tests/unit/script/dom/bindings.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-use script::dom::bindings::str::ByteString;
-
-#[test]
-fn test_byte_string_move() {
- let mut byte_str = ByteString::new(vec![0x73, 0x65, 0x72, 0x76, 0x6f]);
- let mut byte_vec = byte_str.bytes();
-
- assert_eq!(byte_vec, "servo".as_bytes());
- assert_eq!(&*byte_str, &*Vec::<u8>::new());
-
- byte_vec = byte_str.into();
- assert_eq!(byte_vec, Vec::<u8>::new());
-}
diff --git a/tests/unit/script/lib.rs b/tests/unit/script/lib.rs
index c2829292bb9..8446ddc2330 100644
--- a/tests/unit/script/lib.rs
+++ b/tests/unit/script/lib.rs
@@ -13,6 +13,5 @@ extern crate url;
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;
#[cfg(test)] mod textinput;
#[cfg(test)] mod dom {
- mod bindings;
mod blob;
}