aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 15:43:19 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 15:43:19 +0200
commitb220a42caf0066de6f12e0fba0782aee529dd054 (patch)
tree3ff9d282bae3efc47029b30b686ea77985d05f91 /src
parent7895cdf9f4e02b20302dd17dddcef32e6bc42c31 (diff)
downloadmarkdown-rs-b220a42caf0066de6f12e0fba0782aee529dd054.tar.gz
markdown-rs-b220a42caf0066de6f12e0fba0782aee529dd054.tar.bz2
markdown-rs-b220a42caf0066de6f12e0fba0782aee529dd054.zip
Refactor to improve coverage with assertion
Diffstat (limited to 'src')
-rw-r--r--src/event.rs8
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;
}