diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-09-10 07:33:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-10 07:33:25 -0500 |
commit | 84f3cf22bfa3a8897a687e9282b1a9df1cbcb8cc (patch) | |
tree | 256a1d5e82056965040213b43c4ed7deeacf9bbf /components/script/dom/bindings/str.rs | |
parent | 5e7d91829782828e1020652e7bc9d16aa7456499 (diff) | |
parent | 2bc0862f47a937eaf96aec929e884bddd23c6447 (diff) | |
download | servo-84f3cf22bfa3a8897a687e9282b1a9df1cbcb8cc.tar.gz servo-84f3cf22bfa3a8897a687e9282b1a9df1cbcb8cc.zip |
Auto merge of #13185 - nox:namespaces, r=jdm,Ms2ger
Make console a namespace (fixes #13010)
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13185)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/str.rs')
-rw-r--r-- | components/script/dom/bindings/str.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index c73a08d182b..2e28a1b314e 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -5,7 +5,7 @@ //! The `ByteString` struct. use std::ascii::AsciiExt; -use std::borrow::{ToOwned, Cow}; +use std::borrow::{Borrow, Cow, ToOwned}; use std::fmt; use std::hash::{Hash, Hasher}; use std::ops; @@ -180,6 +180,13 @@ impl DOMString { } } +impl Borrow<str> for DOMString { + #[inline] + fn borrow(&self) -> &str { + &self.0 + } +} + impl Default for DOMString { fn default() -> Self { DOMString(String::new()) |