Skip to content

Commit

Permalink
cargo fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglerchris committed Oct 16, 2024
1 parent a0f7fc8 commit ebc3244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/markup5ever_rcdom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,22 @@ impl RcDom {
}
}
NodeData::Doctype { .. } => {
writeln!(s, "{0:indent$}<doctype>", "", indent=indent).unwrap();
writeln!(s, "{0:indent$}<doctype>", "", indent = indent).unwrap();
}
NodeData::Text { contents } => {
let borrowed = contents.borrow();
let text = borrowed.to_string();
if !text.trim().is_empty() {
writeln!(s, "{0:indent$}Text:{1}", "", text, indent=indent).unwrap();
writeln!(s, "{0:indent$}Text:{1}", "", text, indent = indent).unwrap();
}
}
NodeData::Comment { .. } => (),
NodeData::Element { name, .. } => {
writeln!(s, "{0:indent$}<{1}>", "", name.local, indent=indent).unwrap();
writeln!(s, "{0:indent$}<{1}>", "", name.local, indent = indent).unwrap();
for child in &*node.children.borrow() {
Self::add_node_to_string(s, child, indent+1);
Self::add_node_to_string(s, child, indent + 1);
}
writeln!(s, "{0:indent$}</{1}>", "", name.local, indent=indent).unwrap();
writeln!(s, "{0:indent$}</{1}>", "", name.local, indent = indent).unwrap();
}
NodeData::ProcessingInstruction { .. } => {}
}
Expand Down
3 changes: 2 additions & 1 deletion src/render/text_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ impl<T: Clone + Eq + Debug + Default> WrappedBlock<T> {
// Skip the whitespace
self.wslen -= space_in_line;
} else if self.wslen > 0 {
self.line.push_ws(self.wslen, &self.spacetag.take().unwrap());
self.line
.push_ws(self.wslen, &self.spacetag.take().unwrap());
self.wslen = 0;
}
} else {
Expand Down

0 comments on commit ebc3244

Please sign in to comment.