avoid ever setting split_at to 0
This commit is contained in:
parent
d5aad5c1a4
commit
b23f6484e2
1 changed files with 1 additions and 1 deletions
|
|
@ -260,7 +260,7 @@ impl State {
|
||||||
while i > 0 && !remaining.is_char_boundary(i) { i -= 1; }
|
while i > 0 && !remaining.is_char_boundary(i) { i -= 1; }
|
||||||
// To avoid splitting mid-word, see if there was a space recently
|
// To avoid splitting mid-word, see if there was a space recently
|
||||||
let mut j = i;
|
let mut j = i;
|
||||||
while j > 0 && j > i-10 && remaining.as_bytes()[j] != b' ' { j -= 1; }
|
while j > 1 && j > i-10 && remaining.as_bytes()[j] != b' ' { j -= 1; }
|
||||||
if remaining.as_bytes()[j] == b' ' { j }
|
if remaining.as_bytes()[j] == b' ' { j }
|
||||||
else if i == 0 { max_msg } else { i }
|
else if i == 0 { max_msg } else { i }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue