fix clippy

This commit is contained in:
Luke Boswell 2024-01-21 12:24:35 +11:00
parent e7c93bad75
commit ebff47a2aa
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0

View file

@ -22,10 +22,10 @@ pub fn highlight(code: &str) -> Vec<String> {
// Special-case that even though it's normally not a valid highlight.
const REPL_PROMPT: &str = "»";
let code = if code.starts_with(REPL_PROMPT) {
let code = if let Some(stripped) = code.strip_prefix(REPL_PROMPT) {
buf = push_html_span(buf, REPL_PROMPT, "kw");
&code[REPL_PROMPT.len()..]
stripped
} else {
code
};