Skip to content

Commit 1b01d59

Browse files
committed
fmt
1 parent 55288b6 commit 1b01d59

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

html5ever/examples/arena.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,8 @@ impl<'arena> TreeSink for Sink<'arena> {
354354

355355
cloned_node
356356
}
357-
358357
}
359358

360-
361359
/// In this example an "arena" is created and filled with the DOM nodes.
362360
/// "Arena" is a type of allocation in which a block of memory is allocated
363361
/// and later filled with data, DOM nodes in this case. When the arena is deallocated
@@ -387,7 +385,7 @@ fn print_node<'arena>(node: &Node<'arena>, depth: usize) {
387385
if !text.trim().is_empty() {
388386
println!("{}\"{}\"", indent, text.trim());
389387
}
390-
}
388+
},
391389
NodeData::Comment { contents } => println!("{}<!-- {} -->", indent, contents),
392390
NodeData::Element { name, .. } => println!("{}<{}>", indent, name.local),
393391
NodeData::ProcessingInstruction { target, .. } => println!("{}<?{}>", indent, target),

html5ever/examples/noop-tree-builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ impl TreeSink for Sink {
118118
// For this noop example, just return a new placeholder ID
119119
self.get_id()
120120
}
121-
122121
}
123122

124123
/// In this example we implement the TreeSink trait which takes each parsed elements and insert

html5ever/examples/print-tree-actions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ impl TreeSink for Sink {
173173
// For this example, just return a new placeholder ID
174174
self.get_id()
175175
}
176-
177176
}
178177

179178
/// Same example as the "noop-tree-builder", but this time every function implemented in our

html5ever/src/tree_builder/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,9 @@ where
14021402

14031403
self.insert_at(insertion_point, AppendNode(elem.clone()));
14041404

1405-
if qname.local == local_name!("selectedcontent") && self.selectedcontent_elem.borrow().is_none() {
1405+
if qname.local == local_name!("selectedcontent")
1406+
&& self.selectedcontent_elem.borrow().is_none()
1407+
{
14061408
*self.selectedcontent_elem.borrow_mut() = Some(elem.clone());
14071409
}
14081410

@@ -1597,7 +1599,8 @@ where
15971599
}
15981600

15991601
fn clone_option_into_selectedcontent(&self, option: &Handle, selectedcontent: &Handle) {
1600-
self.sink.reparent_children(selectedcontent, &self.sink.get_document());
1602+
self.sink
1603+
.reparent_children(selectedcontent, &self.sink.get_document());
16011604
let cloned_option = self.sink.clone_subtree(option);
16021605
self.sink.reparent_children(&cloned_option, selectedcontent);
16031606
}

html5ever/src/tree_builder/rules.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ where
587587
ProcessResult::Done
588588
},
589589

590-
591590
Token::Tag(
592591
tag @
593592
tag!(</address> | </article> | </aside> | </blockquote> | </button> | </center> |
@@ -640,15 +639,22 @@ where
640639
},
641640

642641
Token::Tag(tag @ tag!(</option>)) => {
643-
let option_in_stack = self.open_elems.borrow()
642+
let option_in_stack = self
643+
.open_elems
644+
.borrow()
644645
.iter()
645646
.find(|elem| self.html_elem_named(elem, local_name!("option")))
646647
.cloned();
647648

648649
self.process_end_tag_in_body(tag);
649650

650651
if let Some(option) = option_in_stack {
651-
if !self.open_elems.borrow().iter().any(|elem| self.sink.same_node(elem, &option)) {
652+
if !self
653+
.open_elems
654+
.borrow()
655+
.iter()
656+
.any(|elem| self.sink.same_node(elem, &option))
657+
{
652658
self.maybe_clone_option_into_selectedcontent(&option);
653659
}
654660
}
@@ -771,9 +777,7 @@ where
771777
)
772778
},
773779

774-
Token::Tag(
775-
tag @ tag!(<area> | <br> | <embed> | <img> | <keygen> | <wbr>),
776-
) => {
780+
Token::Tag(tag @ tag!(<area> | <br> | <embed> | <img> | <keygen> | <wbr>)) => {
777781
self.reconstruct_active_formatting_elements();
778782
self.insert_and_pop_element_for(tag);
779783
self.frameset_ok.set(false);
@@ -805,7 +809,7 @@ where
805809
}
806810

807811
ProcessResult::DoneAckSelfClosing
808-
}
812+
},
809813

810814
Token::Tag(tag @ tag!(<param> | <source> | <track>)) => {
811815
self.insert_and_pop_element_for(tag);

rcdom/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ impl TreeSink for RcDom {
429429
cloned_node
430430
}
431431

432-
433432
fn is_mathml_annotation_xml_integration_point(&self, target: &Handle) -> bool {
434433
if let NodeData::Element {
435434
mathml_annotation_xml_integration_point,

rcdom/tests/html-tree-sink.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ impl TreeSink for LineCountingDOM {
115115
fn clone_subtree(&self, node: &Self::Handle) -> Self::Handle {
116116
self.rcdom.clone_subtree(node)
117117
}
118-
119118
}
120119

121120
#[test]

0 commit comments

Comments
 (0)