Clippy
This commit is contained in:
@@ -17,7 +17,7 @@ impl Render for Markdown<'_> {
|
||||
md.inline.add_rule::<InlineEmote>();
|
||||
md.inline.add_rule::<InlineMdx>();
|
||||
|
||||
let md = md.parse(&self.0);
|
||||
let md = md.parse(self.0);
|
||||
let html = md.render();
|
||||
|
||||
return PreEscaped(html);
|
||||
@@ -165,14 +165,17 @@ fn mdx_style(mdx: &str, _node: &Node, fmt: &mut dyn Renderer) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
#[expect(clippy::unwrap_used)] // Checked previously
|
||||
let k = k.unwrap().trim();
|
||||
|
||||
#[expect(clippy::unwrap_used)] // Checked previously
|
||||
let v = v.unwrap().trim();
|
||||
|
||||
match k {
|
||||
"color" => {
|
||||
style_str.push_str("color:");
|
||||
style_str.push_str(v);
|
||||
style_str.push_str(";");
|
||||
style_str.push(';');
|
||||
}
|
||||
|
||||
"color_var" => {
|
||||
@@ -188,7 +191,7 @@ fn mdx_style(mdx: &str, _node: &Node, fmt: &mut dyn Renderer) -> bool {
|
||||
// Only works with text, could be reworked to do basic md styling
|
||||
// (italics, bold, tab, code)
|
||||
fmt.open("span", &[("style", style_str)]);
|
||||
fmt.text(&content);
|
||||
fmt.text(content);
|
||||
fmt.close("span");
|
||||
|
||||
return true;
|
||||
@@ -225,7 +228,7 @@ fn mdx_include(mdx: &str, _node: &Node, fmt: &mut dyn Renderer) -> bool {
|
||||
|
||||
let args = mdx[skip..end].trim();
|
||||
let trail = mdx[end + 1..].trim();
|
||||
if trail != "" {
|
||||
if !trail.is_empty() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user