chore: Fix several style lints (#17488)

It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-06 11:58:39 +02:00 committed by GitHub
parent 93249fc82b
commit e6c1c51b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
361 changed files with 3530 additions and 3587 deletions

View file

@ -31,6 +31,12 @@ pub struct MarkdownWriter {
pub(crate) markdown: String,
}
impl Default for MarkdownWriter {
fn default() -> Self {
Self::new()
}
}
impl MarkdownWriter {
pub fn new() -> Self {
Self {
@ -64,8 +70,8 @@ impl MarkdownWriter {
self.push_str("\n\n");
}
pub fn run(mut self, root_node: &Handle, handlers: &mut Vec<TagHandler>) -> Result<String> {
self.visit_node(&root_node, handlers)?;
pub fn run(mut self, root_node: &Handle, handlers: &mut [TagHandler]) -> Result<String> {
self.visit_node(root_node, handlers)?;
Ok(Self::prettify_markdown(self.markdown))
}
@ -104,7 +110,7 @@ impl MarkdownWriter {
}
if let Some(current_element) = current_element.as_ref() {
match self.start_tag(&current_element, handlers) {
match self.start_tag(current_element, handlers) {
StartTagOutcome::Continue => {}
StartTagOutcome::Skip => return Ok(()),
}