unicode-linebreak icon indicating copy to clipboard operation
unicode-linebreak copied to clipboard

split at safe always splits at the same point

Open aeosynth opened this issue 2 years ago β€’ 0 comments
trafficstars

Hi, split_at_safe appears to be broken, always splitting at 3 characters to eot.

use unicode_linebreak::split_at_safe;

fn main() {
    let v = vec!["testing", "4321", "a longer sentence 987654321"];

    for s in v {
        let (prev, safe) = split_at_safe(s);
        println!("{}={}", prev, safe);
    }
}

results

test=ing
4=321
a longer sentence 987654=321

aeosynth avatar Dec 06 '22 03:12 aeosynth