Skip to content

Commit

Permalink
Improve Option deconstruction
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisParis committed Aug 16, 2014
1 parent c70b88c commit e3ae54d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/script/dom/htmlscriptelement.rs
Expand Up @@ -52,9 +52,10 @@ impl<'a> HTMLScriptElementMethods for JSRef<'a, HTMLScriptElement> {
let node: &JSRef<Node> = NodeCast::from_ref(self);
let mut content = String::new();
for child in node.children() {
if child.is_text() {
let text: &JSRef<Text> = TextCast::to_ref(&child).unwrap();
content.push_str(text.deref().characterdata.data.deref().borrow().as_slice());
let text: Option<&JSRef<Text>> = TextCast::to_ref(&child);
match text {
Some(text) => content.push_str(text.characterdata.data.borrow().as_slice()),
None => (),
}
}
content
Expand Down

0 comments on commit e3ae54d

Please sign in to comment.