]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/issue-3038.rs
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
[rust.git] / src / tools / rustfmt / tests / source / issue-3038.rs
1 impl HTMLTableElement {
2     fn func() {
3         if number_of_row_elements == 0 {
4             if let Some(last_tbody) = node.rev_children()
5                     .filter_map(DomRoot::downcast::<Element>)
6                     .find(|n| n.is::<HTMLTableSectionElement>() && n.local_name() == &local_name!("tbody")) {
7                         last_tbody.upcast::<Node>().AppendChild(new_row.upcast::<Node>())
8                                                    .expect("InsertRow failed to append first row.");
9                     }
10         }
11
12         if number_of_row_elements == 0 {
13             if let Some(last_tbody) = node
14                     .find(|n| n.is::<HTMLTableSectionElement>() && n.local_name() == &local_name!("tbody")) {
15                         last_tbody.upcast::<Node>().AppendChild(new_row.upcast::<Node>())
16                                                    .expect("InsertRow failed to append first row.");
17                     }
18         }
19     }
20 }