From afab17f055fb3008077baf3551277fd8be52a671 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 23 Apr 2025 11:57:59 +0200 Subject: [PATCH] Refactor code-style --- generate/src/main.rs | 2 +- src/message.rs | 2 +- src/to_html.rs | 6 +++--- src/tokenizer.rs | 2 +- src/util/constant.rs | 2 +- src/util/slice.rs | 2 +- src/util/unicode.rs | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generate/src/main.rs b/generate/src/main.rs index fc4e0fb..76a7147 100644 --- a/generate/src/main.rs +++ b/generate/src/main.rs @@ -153,7 +153,7 @@ async fn punctuation() { /// ## References /// /// * [*§ 2.1 Characters and lines* in `CommonMark`](https://spec.commonmark.org/0.31.2/#unicode-punctuation-character) -pub const PUNCTUATION: [char; {}] = [ +pub static PUNCTUATION: [char; {}] = [ {} ]; ", diff --git a/src/message.rs b/src/message.rs index 4b6e822..5b288dd 100644 --- a/src/message.rs +++ b/src/message.rs @@ -17,7 +17,7 @@ impl fmt::Display for Message { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(ref place) = self.place { write!(f, "{}: ", place)?; - }; + } write!(f, "{} ({}:{})", self.reason, self.source, self.rule_id) } diff --git a/src/to_html.rs b/src/to_html.rs index af4f8e7..b50ec91 100644 --- a/src/to_html.rs +++ b/src/to_html.rs @@ -1448,7 +1448,7 @@ fn on_exit_media(context: &mut CompileContext) { context.push("\""); { #[cfg(feature = "log")] diff --git a/src/util/constant.rs b/src/util/constant.rs index cf27f53..949431b 100644 --- a/src/util/constant.rs +++ b/src/util/constant.rs @@ -306,7 +306,7 @@ pub const THEMATIC_BREAK_MARKER_COUNT_MIN: usize = 3; /// * [*§ 2.5 Entity and numeric character references* in `CommonMark`](https://spec.commonmark.org/0.31/#entity-and-numeric-character-references) /// /// [character_reference]: crate::construct::character_reference -pub const CHARACTER_REFERENCES: [(&str, &str); 2125] = [ +pub static CHARACTER_REFERENCES: [(&str, &str); 2125] = [ ("AElig", "Æ"), ("AMP", "&"), ("Aacute", "Á"), diff --git a/src/util/slice.rs b/src/util/slice.rs index 2d872db..463292d 100644 --- a/src/util/slice.rs +++ b/src/util/slice.rs @@ -75,7 +75,7 @@ impl<'a> Slice<'a> { if before > 0 { before = TAB_SIZE - before; start += 1; - }; + } // If we have virtual spaces after, it means that character is included, // and one less virtual space. diff --git a/src/util/unicode.rs b/src/util/unicode.rs index 93df263..a66a3f3 100644 --- a/src/util/unicode.rs +++ b/src/util/unicode.rs @@ -15,7 +15,7 @@ /// ## References /// /// * [*§ 2.1 Characters and lines* in `CommonMark`](https://spec.commonmark.org/0.31.2/#unicode-punctuation-character) -pub const PUNCTUATION: [char; 8617] = [ +pub static PUNCTUATION: [char; 8617] = [ '\u{0021}', '\u{0022}', '\u{0023}', -- 2.51.2