servo: Merge #5733 - Remove unnecessary clone in Document constructor (from marcusklaas:issue-5719); r=Manishearth
authorMarcus Klaas <mail@marcusklaas.nl>
Fri, 17 Apr 2015 07:53:06 -0500
changeset 336198 779e53d9d413435d76948dba12224208ee090da6
parent 336197 c0d9cb4ec041590e305fd7cebb436e35166b9e0e
child 336199 d8b1af6668d4e40d362f651a28d831318f6f97d3
push id36890
push usergszorc@mozilla.com
push dateFri, 03 Feb 2017 19:58:07 +0000
treeherderautoland@be030db91f00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersManishearth
servo: Merge #5733 - Remove unnecessary clone in Document constructor (from marcusklaas:issue-5719); r=Manishearth This closes issue https://github.com/servo/servo/issues/5719. Source-Repo: https://github.com/servo/servo Source-Revision: c3ed0fd57377c617ef877cd685d3248ce37d1710
servo/components/script/dom/document.rs
--- a/servo/components/script/dom/document.rs
+++ b/servo/components/script/dom/document.rs
@@ -789,17 +789,17 @@ impl Document {
 
         Document {
             node: Node::new_without_doc(NodeTypeId::Document),
             window: JS::from_rooted(window),
             idmap: DOMRefCell::new(HashMap::new()),
             implementation: Default::default(),
             location: Default::default(),
             content_type: match content_type {
-                Some(string) => string.clone(),
+                Some(string) => string,
                 None => match is_html_document {
                     // https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
                     IsHTMLDocument::HTMLDocument => "text/html".to_owned(),
                     // https://dom.spec.whatwg.org/#concept-document-content-type
                     IsHTMLDocument::NonHTMLDocument => "application/xml".to_owned()
                 }
             },
             last_modified: last_modified,