aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorPascal Kuthe2023-03-04 20:53:54 +0000
committerBlaž Hrastnik2023-03-05 06:54:02 +0000
commitccdb1446652662e2577fb7405fee9ccd49c56180 (patch)
tree9b8bb8580cfa3bf4bb88e8d0cd1708e55ee14c58 /helix-term/src/ui
parent5b4e73f37dea1b199e30610f255731f110a4a605 (diff)
update MSRV to 1.65
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/document.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs
index 4f615f7b..28a52f74 100644
--- a/helix-term/src/ui/document.rs
+++ b/helix-term/src/ui/document.rs
@@ -202,10 +202,7 @@ pub fn render_text<'t>(
// formattter.line_pos returns to line index of the next grapheme
// so it must be called before formatter.next
let doc_line = formatter.line_pos();
- // TODO refactor with let .. else once MSRV reaches 1.65
- let (grapheme, mut pos) = if let Some(it) = formatter.next() {
- it
- } else {
+ let Some((grapheme, mut pos)) = formatter.next() else {
let mut last_pos = formatter.visual_pos();
if last_pos.row >= row_off {
last_pos.col -= 1;
@@ -226,7 +223,6 @@ pub fn render_text<'t>(
// skip any graphemes on visual lines before the block start
if pos.row < row_off {
if char_pos >= style_span.1 {
- // TODO refactor using let..else once MSRV reaches 1.65
style_span = if let Some(style_span) = styles.next() {
style_span
} else {
@@ -266,12 +262,7 @@ pub fn render_text<'t>(
// aquire the correct grapheme style
if char_pos >= style_span.1 {
- // TODO refactor using let..else once MSRV reaches 1.65
- style_span = if let Some(style_span) = styles.next() {
- style_span
- } else {
- (Style::default(), usize::MAX)
- }
+ style_span = styles.next().unwrap_or((Style::default(), usize::MAX));
}
char_pos += grapheme.doc_chars();