Upgrade to icu4x 2.0.0

Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
Nico Burns 2025-07-02 02:56:03 +01:00
parent a13f9bce62
commit 96f599bdf1
6 changed files with 319 additions and 96 deletions

View file

@ -5,6 +5,7 @@
use std::ops::Range;
use icu_segmenter::LineSegmenter;
use icu_segmenter::options::LineBreakOptions;
pub(crate) struct LineBreaker {
linebreaks: Vec<usize>,
@ -13,7 +14,7 @@ pub(crate) struct LineBreaker {
impl LineBreaker {
pub(crate) fn new(string: &str) -> Self {
let line_segmenter = LineSegmenter::new_auto();
let line_segmenter = LineSegmenter::new_auto(LineBreakOptions::default());
Self {
// From https://docs.rs/icu_segmenter/1.5.0/icu_segmenter/struct.LineSegmenter.html
// > For consistency with the grapheme, word, and sentence segmenters, there is always a