From 76ca5401426809a6ec6f47665377d498e7038cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Sun, 30 Oct 2022 14:54:50 +0100 Subject: [PATCH] markdown: Fix clippy warnings --- components/markdown/src/markdown.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs index 3d817b7813..6d66f88d55 100644 --- a/components/markdown/src/markdown.rs +++ b/components/markdown/src/markdown.rs @@ -539,12 +539,10 @@ pub fn markdown_to_html( .context("Failed to render anchor link template")?; if context.insert_anchor != InsertAnchor::Heading { anchors_to_insert.push((anchor_idx, Event::Html(anchor_link.into()))); - } else { - if let Some(captures) = A_HTML_TAG.captures(&anchor_link) { - let opening_tag = captures.get(1).map_or("", |m| m.as_str()).to_string(); - anchors_to_insert.push((start_idx + 1, Event::Html(opening_tag.into()))); - anchors_to_insert.push((end_idx, Event::Html("".into()))); - } + } else if let Some(captures) = A_HTML_TAG.captures(&anchor_link) { + let opening_tag = captures.get(1).map_or("", |m| m.as_str()).to_string(); + anchors_to_insert.push((start_idx + 1, Event::Html(opening_tag.into()))); + anchors_to_insert.push((end_idx, Event::Html("".into()))); } }