mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update to string-cache 0.3
This commit is contained in:
parent
9fcc9d9d3f
commit
53b638c0e2
170 changed files with 1309 additions and 1050 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
//! The `ByteString` struct.
|
||||
|
||||
use html5ever_atoms::{LocalName, Namespace};
|
||||
use servo_atoms::Atom;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::{Borrow, Cow, ToOwned};
|
||||
use std::fmt;
|
||||
|
@ -12,7 +14,6 @@ use std::ops;
|
|||
use std::ops::{Deref, DerefMut};
|
||||
use std::str;
|
||||
use std::str::{Bytes, FromStr};
|
||||
use string_cache::Atom;
|
||||
|
||||
/// Encapsulates the IDL `ByteString` type.
|
||||
#[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf, Debug)]
|
||||
|
@ -255,6 +256,18 @@ impl<'a> From<Cow<'a, str>> for DOMString {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<DOMString> for LocalName {
|
||||
fn from(contents: DOMString) -> LocalName {
|
||||
LocalName::from(contents.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DOMString> for Namespace {
|
||||
fn from(contents: DOMString) -> Namespace {
|
||||
Namespace::from(contents.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DOMString> for Atom {
|
||||
fn from(contents: DOMString) -> Atom {
|
||||
Atom::from(contents.0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue