diff options
author | Thomas Hurst <tom@hur.st> | 2018-09-04 21:40:18 +0100 |
---|---|---|
committer | Kartikaya Gupta (kats) <staktrace@users.noreply.github.com> | 2018-09-04 21:06:35 -0400 |
commit | 80d7b5ed49cf56ba7713cfb9d091f140fa0e101f (patch) | |
tree | 500f3c99c0d9df8c2639d59b6520047bc244443c /.gitignore | |
parent | 03a4b80888a677a78bd0b3e0be19303a71e261f0 (diff) |
Fix #26: Incorrect unwrap() guard in is_boundary()
Guarding line.chars().nth(n) by enforcing n <= line.len() is incorrect,
because len() operates in bytes, not Unicode characters.
Drop the guard and make use of nth()'s Option to conditionally check the
character if it's within bounds.
Add a test to prevent regressions.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions