Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split at safe always splits at the same point #6

Open
aeosynth opened this issue Dec 6, 2022 · 0 comments
Open

split at safe always splits at the same point #6

aeosynth opened this issue Dec 6, 2022 · 0 comments

Comments

@aeosynth
Copy link

aeosynth commented Dec 6, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant