1
Fork 0

Replace some _ == _ || _ == _s with matches!(_, _ | _)s

This commit is contained in:
Maybe Waffle 2023-01-30 12:01:09 +00:00
parent 4d75f61832
commit f1d273cbfb
7 changed files with 7 additions and 7 deletions

View file

@ -142,7 +142,7 @@ impl StyledBuffer {
pub fn set_style(&mut self, line: usize, col: usize, style: Style, overwrite: bool) {
if let Some(ref mut line) = self.lines.get_mut(line) {
if let Some(StyledChar { style: s, .. }) = line.get_mut(col) {
if overwrite || *s == Style::NoStyle || *s == Style::Quotation {
if overwrite || matches!(s, Style::NoStyle | Style::Quotation) {
*s = style;
}
}