aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-03-29 13:33:02 -0400
committerCorey Farwell <coreyf@rwell.org>2015-03-29 14:42:19 -0400
commitd838fcce30d56e02bd22c4bcfca04d39bf4fc38e (patch)
tree3a906417b1c164990bc308ff790913b9c7c08740 /components/script/dom/bindings
parentb8ea10bfe3386357b68e5564332cf8ac9d5377bb (diff)
downloadservo-d838fcce30d56e02bd22c4bcfca04d39bf4fc38e.tar.gz
servo-d838fcce30d56e02bd22c4bcfca04d39bf4fc38e.zip
Remove some unnecessary uses of `as_slice`
For the majority of these cases, `as_slice` can be removed due to `Deref`. In particular, `Deref` for: * `String` -> `str` * `Atom` -> `str` The latter of those two requires, a bump of the locked `string-cache` library
Diffstat (limited to 'components/script/dom/bindings')
-rw-r--r--components/script/dom/bindings/str.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index 88561210617..95ee01d8517 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -24,7 +24,7 @@ impl ByteString {
/// otherwise.
pub fn as_str<'a>(&'a self) -> Option<&'a str> {
let ByteString(ref vec) = *self;
- str::from_utf8(vec.as_slice()).ok()
+ str::from_utf8(&vec).ok()
}
/// Returns the underlying vector as a slice.