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
This commit is contained in:
Corey Farwell 2015-03-29 13:33:02 -04:00
parent b8ea10bfe3
commit d838fcce30
19 changed files with 98 additions and 102 deletions

View file

@ -26,7 +26,7 @@ pub fn handle_evaluate_js(page: &Rc<Page>, pipeline: PipelineId, eval: String, r
let page = get_page(&*page, pipeline);
let window = page.window().root();
let cx = window.r().get_cx();
let rval = window.r().evaluate_js_on_global_with_result(eval.as_slice());
let rval = window.r().evaluate_js_on_global_with_result(&eval);
reply.send(if rval.is_undefined() {
EvaluateJSReply::VoidValue
@ -69,7 +69,7 @@ fn find_node_by_unique_id(page: &Rc<Page>, pipeline: PipelineId, node_id: String
let node: JSRef<Node> = NodeCast::from_ref(document.r());
for candidate in node.traverse_preorder() {
if candidate.get_unique_id().as_slice() == node_id.as_slice() {
if candidate.get_unique_id() == node_id {
return Temporary::from_rooted(candidate);
}
}