aboutsummaryrefslogtreecommitdiff
path: root/src/gemini_parser.rs
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-01-04 02:20:55 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-01-04 02:20:55 +0100
commit8766e4412b95cfa0288683748cc20aba81a64d08 (patch)
treeb068bbd32915b2c0ca846465edfd6cb9bf718d6c /src/gemini_parser.rs
parentb03284133baa6339fe4adf48e4a6499ef3ac287b (diff)
Address pedantic issues
Diffstat (limited to 'src/gemini_parser.rs')
-rw-r--r--src/gemini_parser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gemini_parser.rs b/src/gemini_parser.rs
index e6de4ec..49d954a 100644
--- a/src/gemini_parser.rs
+++ b/src/gemini_parser.rs
@@ -8,7 +8,7 @@ pub enum GeminiLine {
ListItem(String),
}
-/// Parses gemtext source code into a vector of GeminiLine elements.
+/// Parses gemtext source code into a vector of `GeminiLine` elements.
///
/// # Arguments
/// * `source` - A string slice that contains the gemtext
@@ -47,7 +47,7 @@ fn parse_line(line: &str) -> GeminiLine {
match line {
s if s.starts_with("###") => GeminiLine::Heading(3, s[3..].to_string()),
s if s.starts_with("##") => GeminiLine::Heading(2, s[2..].to_string()),
- s if s.starts_with("#") => GeminiLine::Heading(1, s[1..].to_string()),
+ s if s.starts_with('#') => GeminiLine::Heading(1, s[1..].to_string()),
s if s.starts_with("=>") => {
let content = s[2..].trim();
match content.split_once(char::is_whitespace) {
@@ -58,7 +58,7 @@ fn parse_line(line: &str) -> GeminiLine {
}
}
s if s.starts_with("* ") => GeminiLine::ListItem(s[2..].to_string()),
- s if s.starts_with(">") => GeminiLine::Quote(s[1..].to_string()),
+ s if s.starts_with('>') => GeminiLine::Quote(s[1..].to_string()),
s if s.starts_with("```") => GeminiLine::PreformattedToggle(true, s[3..].to_string()),
_ => GeminiLine::Text(line.to_string(), false),
}