diff options
author | Chris Paris <cap@chrisparis.org> | 2015-03-26 13:10:56 -1000 |
---|---|---|
committer | Chris Paris <cap@chrisparis.org> | 2015-04-06 12:56:56 -1000 |
commit | d83f4d8a6ec63d3755ad43f10f3cfbf2155dd48a (patch) | |
tree | 8bfdcd0adc7a351027693c2f5b7159f9e808763a | |
parent | 3542360d001e91e073c387a73b1c6566a4ddff7f (diff) | |
download | servo-d83f4d8a6ec63d3755ad43f10f3cfbf2155dd48a.tar.gz servo-d83f4d8a6ec63d3755ad43f10f3cfbf2155dd48a.zip |
get rid of and_then in outerHTML setter
-rw-r--r-- | components/script/dom/element.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 63ccf21bdde..37bf2d2ca23 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1217,13 +1217,10 @@ impl<'a> ElementMethods for JSRef<'a, Element> { // 5. Let fragment be the result of invoking the fragment parsing algorithm with // the new value as markup, and parent as the context element. // 6. Replace the context object with fragment within the context object's parent. - parent.r().parse_fragment(value) - .and_then(|frag| { - let frag = frag.root(); - let frag_node: JSRef<Node> = NodeCast::from_ref(frag.r()); - try!(context_parent.r().ReplaceChild(frag_node, context_node)); - Ok(()) - }) + let frag = try!(parent.r().parse_fragment(value)); + try!(context_parent.r().ReplaceChild(NodeCast::from_ref(frag.root().r()), + context_node)); + Ok(()) } // http://dom.spec.whatwg.org/#dom-parentnode-children |