@@ -10,7 +10,7 @@ use std::{
1010 path:: Path ,
1111} ;
1212
13- use crate :: zhuyin:: { Syllable , SyllableSlice } ;
13+ use crate :: zhuyin:: Syllable ;
1414
1515pub use layered:: Layered ;
1616pub use loader:: {
@@ -343,7 +343,7 @@ pub trait Dictionary: Debug {
343343 /// The result should use a stable order each time for the same input.
344344 fn lookup_first_n_phrases (
345345 & self ,
346- syllables : & dyn SyllableSlice ,
346+ syllables : & [ Syllable ] ,
347347 first : usize ,
348348 strategy : LookupStrategy ,
349349 ) -> Vec < Phrase > ;
@@ -352,7 +352,7 @@ pub trait Dictionary: Debug {
352352 /// The result should use a stable order each time for the same input.
353353 fn lookup_first_phrase (
354354 & self ,
355- syllables : & dyn SyllableSlice ,
355+ syllables : & [ Syllable ] ,
356356 strategy : LookupStrategy ,
357357 ) -> Option < Phrase > {
358358 self . lookup_first_n_phrases ( syllables, 1 , strategy)
@@ -362,11 +362,7 @@ pub trait Dictionary: Debug {
362362 /// Returns all phrases matched by the syllables.
363363 ///
364364 /// The result should use a stable order each time for the same input.
365- fn lookup_all_phrases (
366- & self ,
367- syllables : & dyn SyllableSlice ,
368- strategy : LookupStrategy ,
369- ) -> Vec < Phrase > {
365+ fn lookup_all_phrases ( & self , syllables : & [ Syllable ] , strategy : LookupStrategy ) -> Vec < Phrase > {
370366 self . lookup_first_n_phrases ( syllables, usize:: MAX , strategy)
371367 }
372368 /// Returns an iterator to all phrases in the dictionary.
@@ -410,14 +406,14 @@ pub trait DictionaryMut: Debug {
410406 /// TODO: doc
411407 fn add_phrase (
412408 & mut self ,
413- syllables : & dyn SyllableSlice ,
409+ syllables : & [ Syllable ] ,
414410 phrase : Phrase ,
415411 ) -> Result < ( ) , UpdateDictionaryError > ;
416412
417413 /// TODO: doc
418414 fn update_phrase (
419415 & mut self ,
420- syllables : & dyn SyllableSlice ,
416+ syllables : & [ Syllable ] ,
421417 phrase : Phrase ,
422418 user_freq : u32 ,
423419 time : u64 ,
@@ -426,7 +422,7 @@ pub trait DictionaryMut: Debug {
426422 /// TODO: doc
427423 fn remove_phrase (
428424 & mut self ,
429- syllables : & dyn SyllableSlice ,
425+ syllables : & [ Syllable ] ,
430426 phrase_str : & str ,
431427 ) -> Result < ( ) , UpdateDictionaryError > ;
432428}
0 commit comments