From f0c7ad11b277dd4958fd825bb809adc08eec114c Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 10 Jun 2024 12:04:33 +0000 Subject: [PATCH] Refactor code-style --- src/configuration.rs | 2 ++ src/event.rs | 2 +- src/mdast.rs | 2 ++ src/to_mdast.rs | 2 +- 4 file(s) changed, 6 insertion(s)(+), 2 deletion(s)(-) diff --git a/src/configuration.rs b/src/configuration.rs --- a/src/configuration.rs +++ b/src/configuration.rs @@ -553,6 +553,8 @@ /// # } /// ``` pub allow_dangerous_protocol: bool, + // To do: `doc_markdown` is broken. + #[allow(clippy::doc_markdown)] /// Default line ending to use when compiling to HTML, for line endings not /// in `value`. /// diff --git a/src/event.rs b/src/event.rs --- a/src/event.rs +++ b/src/event.rs @@ -3266,7 +3266,7 @@ /// > | a ![b]( "d") e /// ^ /// ``` ResourceTitleString, - /// SpaceOrTab. + /// Space or tab. /// /// ## Info /// diff --git a/src/mdast.rs b/src/mdast.rs --- a/src/mdast.rs +++ b/src/mdast.rs @@ -224,6 +224,8 @@ fn children_to_string(children: &[Node]) -> String { children.iter().map(ToString::to_string).collect() } +// To do: clippy may be right but that’s a breaking change. +#[allow(clippy::to_string_trait_impl)] impl ToString for Node { fn to_string(&self) -> String { match self { diff --git a/src/to_mdast.rs b/src/to_mdast.rs --- a/src/to_mdast.rs +++ b/src/to_mdast.rs @@ -1280,7 +1280,7 @@ let reference = context .media_reference_stack .last_mut() .expect("expected reference on media stack"); - reference.label = label.clone(); + reference.label.clone_from(&label); reference.identifier = identifier; match context.tail_mut() { -- tangled.sh