From b220a42caf0066de6f12e0fba0782aee529dd054 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 15:43:19 +0200 Subject: Refactor to improve coverage with assertion --- src/event.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/event.rs b/src/event.rs index b3fa9ae..a63a475 100644 --- a/src/event.rs +++ b/src/event.rs @@ -3512,12 +3512,8 @@ impl Point { b'\n' | b'\r' => unreachable!("cannot move past line endings"), b'\t' => { let remainder = next.column % TAB_SIZE; - let vs = if remainder == 0 { - 0 - } else { - TAB_SIZE - remainder - }; - + debug_assert_ne!(remainder, 0, "expected remainder larger than `0`"); + let vs = TAB_SIZE - remainder; next.index += 1; next.column += 1 + vs; } -- cgit