Fix line length calculation (should be in chars, not bytes)

This commit is contained in:
Stanislav Tkach 2017-04-19 17:49:03 +03:00
parent b4833a8c58
commit b53aeebbcf
3 changed files with 9 additions and 1 deletions

View File

@ -511,7 +511,7 @@ fn format_lines(text: &mut StringBuffer, name: &str, config: &Config, report: &m
last_wspace = None;
} else {
newline_count = 0;
line_len += c.len_utf8();
line_len += 1;
if c.is_whitespace() {
if last_wspace.is_none() {
last_wspace = Some(b);

View File

@ -0,0 +1,4 @@
// rustfmt-max_width: 25
// абвгдеёжзийклмнопрст
fn main() {}

View File

@ -0,0 +1,4 @@
// rustfmt-max_width: 25
// абвгдеёжзийклмнопрст
fn main() {}