mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
script: Simplify Node::collect_text_contents.
This commit is contained in:
parent
157ce33105
commit
2bbde04ccd
1 changed files with 2 additions and 3 deletions
|
@ -1792,9 +1792,8 @@ impl Node {
|
|||
pub fn collect_text_contents<T: Iterator<Item=Root<Node>>>(iterator: T) -> DOMString {
|
||||
let mut content = String::new();
|
||||
for node in iterator {
|
||||
match node.downcast::<Text>() {
|
||||
Some(ref text) => content.push_str(&text.upcast::<CharacterData>().data()),
|
||||
None => (),
|
||||
if let Some(ref text) = node.downcast::<Text>() {
|
||||
content.push_str(&text.upcast::<CharacterData>().data());
|
||||
}
|
||||
}
|
||||
DOMString::from(content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue