Merge pull request #1461 from DarkEld3r/1447-line-length-in-chars

Fix line length calculation (should be in chars, not bytes)
This commit is contained in:
Nick Cameron 2017-05-01 13:15:28 +12:00 committed by GitHub
commit 6a19c93f2a
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() {}