diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-10-13 15:43:19 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-10-13 15:43:19 +0200 |
commit | b220a42caf0066de6f12e0fba0782aee529dd054 (patch) | |
tree | 3ff9d282bae3efc47029b30b686ea77985d05f91 | |
parent | 7895cdf9f4e02b20302dd17dddcef32e6bc42c31 (diff) | |
download | markdown-rs-b220a42caf0066de6f12e0fba0782aee529dd054.tar.gz markdown-rs-b220a42caf0066de6f12e0fba0782aee529dd054.tar.bz2 markdown-rs-b220a42caf0066de6f12e0fba0782aee529dd054.zip |
Refactor to improve coverage with assertion
-rw-r--r-- | src/event.rs | 8 |
1 files changed, 2 insertions, 6 deletions
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; } |