Skip to content

Fix compile error: adapt to jieba-rs 0.10.1 Token API#1152

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-compile-issue
Draft

Fix compile error: adapt to jieba-rs 0.10.1 Token API#1152
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-compile-issue

Conversation

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

jieba-rs 0.10.1 changed cut, cut_all, and cut_for_search to return Vec<Token<'a>> instead of Vec<&'a str>. This breaks compilation on main.

  • Extract .word from each Token in cut(), cut_all(), cut_for_search() before passing to Array::from_vec
  • Fix CutTask::compute() to use t.word.to_string() on the new Token type
// Before (no longer compiles)
let cutted = self.0.cut(sentence, hmm);
Array::from_vec(env, cutted)

// After
let cutted: Vec<&str> = self.0.cut(sentence, hmm)
    .into_iter()
    .map(|t| t.word)
    .collect();
Array::from_vec(env, cutted)

Copilot AI changed the title Fix compile issue on main branch: adapt jieba bindings to jieba-rs 0.10.1 Token API Fix compile error: adapt to jieba-rs 0.10.1 Token API Jun 14, 2026
Copilot AI requested a review from Brooooooklyn June 14, 2026 08:02
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

Successfully merging this pull request may close these issues.

2 participants