diff options
Diffstat (limited to 'components/util/str.rs')
-rw-r--r-- | components/util/str.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/util/str.rs b/components/util/str.rs index 2ffde43fedf..9d0869ccced 100644 --- a/components/util/str.rs +++ b/components/util/str.rs @@ -11,6 +11,7 @@ use std::fmt; use std::iter::{Filter, Peekable}; use std::ops::{Deref, DerefMut}; use std::str::{Bytes, CharIndices, FromStr, Split, from_utf8}; +use string_cache::Atom; #[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)] pub struct DOMString(String); @@ -96,6 +97,12 @@ impl<'a> From<&'a str> for DOMString { } } +impl From<DOMString> for Atom { + fn from(contents: DOMString) -> Atom { + Atom::from(contents.0) + } +} + impl From<DOMString> for String { fn from(contents: DOMString) -> String { contents.0 |