Cleaning language

This commit is contained in:
2026-01-29 01:10:53 +01:00
parent db5237480a
commit 7e4f8d0e46
10 changed files with 57 additions and 68 deletions

View File

@@ -187,6 +187,7 @@ fn render_devices(frame: &mut Frame, app: &App, area: Rect) {
);
}
#[allow(clippy::too_many_arguments)]
fn render_device_column(
frame: &mut Frame,
area: Rect,

View File

@@ -242,7 +242,7 @@ fn parse_markdown(md: &str) -> Vec<RLine<'static>> {
match line {
Line::Normal(composite) if composite.style == CompositeStyle::Code => {
code_line_nr += 1;
let raw: String = composite.compounds.iter().map(|c| &*c.src).collect();
let raw: String = composite.compounds.iter().map(|c: &minimad::Compound| c.src).collect();
let mut spans = vec![
Span::styled(format!(" {code_line_nr:>2} "), code_border_style()),
Span::styled("", code_border_style()),

View File

@@ -97,24 +97,14 @@ pub fn tokenize_line(line: &str) -> Vec<Token> {
continue;
}
if c == '(' {
let end = line.len();
let comment_end = line[start..]
.find(')')
.map(|i| start + i + 1)
.unwrap_or(end);
if c == ';' && chars.peek().map(|(_, ch)| *ch) == Some(';') {
// ;; starts a comment to end of line
tokens.push(Token {
start,
end: comment_end,
end: line.len(),
kind: TokenKind::Comment,
});
while let Some((i, _)) = chars.peek() {
if *i >= comment_end {
break;
}
chars.next();
}
continue;
break;
}
if c == '"' {