aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/devtools.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2015-11-02 16:04:10 +0100
committerMs2ger <Ms2ger@gmail.com>2015-11-02 16:04:49 +0100
commit13291c4b64032931a38cd0671075287d87594732 (patch)
tree9f4de8030bdf1ea4a58079f473526f63c2914573 /components/script/devtools.rs
parent5c11c88e92ccbc3013501096d5625778774c9fee (diff)
downloadservo-13291c4b64032931a38cd0671075287d87594732.tar.gz
servo-13291c4b64032931a38cd0671075287d87594732.zip
Avoid some string copies in handle_modify_attribute.
Diffstat (limited to 'components/script/devtools.rs')
-rw-r--r--components/script/devtools.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/devtools.rs b/components/script/devtools.rs
index bc6dc34ad4f..3ea1448e099 100644
--- a/components/script/devtools.rs
+++ b/components/script/devtools.rs
@@ -155,12 +155,12 @@ pub fn handle_modify_attribute(page: &Rc<Page>,
let node = find_node_by_unique_id(&*page, pipeline, node_id);
let elem = node.downcast::<Element>().expect("should be getting layout of element");
- for modification in &modifications {
+ for modification in modifications {
match modification.newValue {
- Some(ref string) => {
- let _ = elem.SetAttribute(modification.attributeName.clone(), string.clone());
+ Some(string) => {
+ let _ = elem.SetAttribute(modification.attributeName, string);
},
- None => elem.RemoveAttribute(modification.attributeName.clone()),
+ None => elem.RemoveAttribute(modification.attributeName),
}
}
}