Skip to content

Commit

Permalink
chore: remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpDays committed Jun 2, 2024
1 parent a9230bd commit 3b4a1bb
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/tools/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ enum HighlightKind {
Block(Highlighter<BlockHighlight>),
Line(Highlighter<LineHighlight>),
}
impl HighlightKind {
fn highlight(&self, canvas: &mut femtovg::Canvas<femtovg::renderer::OpenGl>) {
let _ = match self {
HighlightKind::Block(highlighter) => highlighter.highlight(canvas),
HighlightKind::Line(highlighter) => highlighter.highlight(canvas),
};
}
}

#[derive(Default, Clone, Debug)]
pub struct HighlightTool {
Expand All @@ -121,8 +113,10 @@ impl Drawable for HighlightKind {
canvas: &mut femtovg::Canvas<femtovg::renderer::OpenGl>,
_font: femtovg::FontId,
) -> Result<()> {
self.highlight(canvas);
Ok(())
match self {
HighlightKind::Block(highlighter) => highlighter.highlight(canvas),
HighlightKind::Line(highlighter) => highlighter.highlight(canvas),
}
}
}

Expand Down

0 comments on commit 3b4a1bb

Please sign in to comment.