Don't return Result from TextStyle::highlight

This commit is contained in:
Antonio Scandurra 2023-11-15 09:10:46 +01:00
parent 48b3a90fbf
commit 1def355d44
4 changed files with 13 additions and 27 deletions

View file

@ -578,12 +578,7 @@ impl DisplaySnapshot {
line.push_str(chunk.chunk);
let text_style = if let Some(style) = chunk.style {
editor_style
.text
.clone()
.highlight(style)
.map(Cow::Owned)
.unwrap_or_else(|_| Cow::Borrowed(&editor_style.text))
Cow::Owned(editor_style.text.clone().highlight(style))
} else {
Cow::Borrowed(&editor_style.text)
};