diff options
author | Pascal Kuthe | 2023-03-04 20:53:54 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-03-05 06:54:02 +0000 |
commit | ccdb1446652662e2577fb7405fee9ccd49c56180 (patch) | |
tree | 9b8bb8580cfa3bf4bb88e8d0cd1708e55ee14c58 /helix-term/src | |
parent | 5b4e73f37dea1b199e30610f255731f110a4a605 (diff) |
update MSRV to 1.65
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 5 | ||||
-rw-r--r-- | helix-term/src/ui/document.rs | 13 |
2 files changed, 3 insertions, 15 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index fb55ca2a..7b9b5943 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3061,10 +3061,7 @@ fn goto_next_change_impl(cx: &mut Context, direction: Direction) { .prev_hunk(cursor_line) .map(|idx| idx.saturating_sub(count)), }; - // TODO refactor with let..else once MSRV reaches 1.65 - let hunk_idx = if let Some(hunk_idx) = hunk_idx { - hunk_idx - } else { + let Some(hunk_idx) = hunk_idx else { return range; }; let hunk = hunks.nth_hunk(hunk_idx); 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(); |