Simplify arithmetic operation in logical lines checker (#11346)
## Summary Simplify arithmetic operation in logical lines checker
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user