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

@ -2253,11 +2253,7 @@ impl LineWithInvisibles {
if !line_chunk.is_empty() && !line_exceeded_max_len {
let text_style = if let Some(style) = highlighted_chunk.style {
text_style
.clone()
.highlight(style)
.map(Cow::Owned)
.unwrap_or_else(|_| Cow::Borrowed(text_style))
Cow::Owned(text_style.clone().highlight(style))
} else {
Cow::Borrowed(text_style)
};