Add the comment to explain the dual declaration.

This commit is contained in:
Tetsuharu OHZEKI 2014-01-08 23:14:52 +09:00
parent fd0dadbddf
commit 31e2f22d20

View file

@ -219,6 +219,8 @@ impl Element {
self.style_attribute = Some(style::parse_style_attribute(value)) self.style_attribute = Some(style::parse_style_attribute(value))
} }
"id" => { "id" => {
// XXX: this dual declaration are workaround to avoid the compile error:
// "borrowed value does not live long enough"
let doc = self.node.owner_doc(); let doc = self.node.owner_doc();
let doc = doc.mut_document(); let doc = doc.mut_document();
doc.update_idmap(abstract_self, Some(value.clone()), old_value); doc.update_idmap(abstract_self, Some(value.clone()), old_value);