Simplify arithmetic operation in logical lines checker (#11346)

## Summary

Simplify arithmetic operation in logical lines checker
This commit is contained in:
Auguste Lalande
2024-05-08 20:59:56 -04:00
committed by GitHub
parent dfe4291c0b
commit e9d1cddc97

View File

@@ -24,7 +24,7 @@ pub(crate) fn expand_indent(line: &str, indent_width: IndentWidth) -> usize {
let tab_size = indent_width.as_usize();
for c in line.bytes() {
match c {
b'\t' => indent = (indent / tab_size) * tab_size + tab_size,
b'\t' => indent += tab_size,
b' ' => indent += 1,
_ => break,
}