messense/jieba-rs

`Jieba::add_word` panics when given empty `word`

usaoc opened this issue · 0 comments

Example:

use jieba_rs::Jieba;

fn main() {
    let mut jieba = Jieba::new();
    jieba.add_word("", None, None);
}

gives

thread 'main' panicked at /path/to/cedarwood-0.4.6/src/lib.rs:302:13:
failed to insert zero-length key

Should the panic message be improved, and a note be added to the doc?