Skip to content

Commit

Permalink
Address compiler bug with variable shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
Omnikar committed Nov 4, 2021
1 parent 70091f7 commit 91c5dce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helix-tui/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ impl Buffer {
} else {
let mut start_index = self.index_of(x, y);
let mut index = self.index_of(max_offset as u16, y);
// This variable is used at the end of the following `for` loop. The warn is a compiler bug.
#[allow(unused_variables)]
let mut x_offset = max_offset;

let total_width = string.as_ref().width();
let truncated = total_width > width;
Expand Down

0 comments on commit 91c5dce

Please # to comment.