mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Remove unused code from script* crates
This commit is contained in:
parent
8dc7a25893
commit
8b6ed3d182
13 changed files with 2 additions and 133 deletions
|
@ -168,9 +168,6 @@ pub mod codegen {
|
|||
pub mod InterfaceObjectMap {
|
||||
include!(concat!(env!("OUT_DIR"), "/InterfaceObjectMap.rs"));
|
||||
}
|
||||
pub mod InterfaceTypes {
|
||||
include!(concat!(env!("OUT_DIR"), "/InterfaceTypes.rs"));
|
||||
}
|
||||
#[allow(dead_code, unused_imports)]
|
||||
pub mod InheritTypes {
|
||||
include!(concat!(env!("OUT_DIR"), "/InheritTypes.rs"));
|
||||
|
|
|
@ -671,14 +671,6 @@ impl<T: DomObject> LayoutDom<T> {
|
|||
debug_assert!(thread_state::get().is_layout());
|
||||
self.ptr.as_ptr()
|
||||
}
|
||||
|
||||
/// Returns a reference to the interior of this JS object. This method is
|
||||
/// safe to call because it originates from the layout thread, and it cannot
|
||||
/// mutate DOM nodes.
|
||||
pub fn get_for_script(&self) -> &T {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
unsafe { &*self.ptr.as_ptr() }
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper trait for safer manipulations of `Option<Heap<T>>` values.
|
||||
|
|
|
@ -17,7 +17,7 @@ use std::marker::PhantomData;
|
|||
use std::ops;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::str;
|
||||
use std::str::{Bytes, FromStr};
|
||||
use std::str::FromStr;
|
||||
|
||||
/// Encapsulates the IDL `ByteString` type.
|
||||
#[derive(Clone, Debug, Default, Eq, JSTraceable, MallocSizeOf, PartialEq)]
|
||||
|
@ -40,11 +40,6 @@ impl ByteString {
|
|||
self.0.len()
|
||||
}
|
||||
|
||||
/// Compare `self` to `other`, matching A–Z and a–z as equal.
|
||||
pub fn eq_ignore_case(&self, other: &ByteString) -> bool {
|
||||
self.0.eq_ignore_ascii_case(&other.0)
|
||||
}
|
||||
|
||||
/// Returns `self` with A–Z replaced by a–z.
|
||||
pub fn to_lower(&self) -> ByteString {
|
||||
ByteString::new(self.0.to_ascii_lowercase())
|
||||
|
@ -219,11 +214,6 @@ impl DOMString {
|
|||
self.0.truncate(new_len);
|
||||
}
|
||||
|
||||
/// An iterator over the bytes of this `DOMString`.
|
||||
pub fn bytes(&self) -> Bytes {
|
||||
self.0.bytes()
|
||||
}
|
||||
|
||||
/// Removes newline characters according to <https://infra.spec.whatwg.org/#strip-newlines>.
|
||||
pub fn strip_newlines(&mut self) {
|
||||
self.0.retain(|c| c != '\r' && c != '\n');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue