Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuuuube committed Jun 27, 2024
1 parent 81b4084 commit ae095ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sudachi/src/dic/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ impl JapaneseDictionary {
cfg: &Config,
storage: SudachiDicData,
) -> SudachiResult<JapaneseDictionary> {
let mut basic_dict = LoadedDictionary::from_system_dictionary_embedded( unsafe { storage.system_static_slice() } )?;
let mut basic_dict = LoadedDictionary::from_system_dictionary_embedded(unsafe {
storage.system_static_slice()
})?;

let plugins = {
let grammar = &mut basic_dict.grammar;
Expand Down
10 changes: 8 additions & 2 deletions sudachi/src/dic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,21 @@ impl<'a> LoadedDictionary<'a> {
character_category_file: &Path,
) -> SudachiResult<LoadedDictionary<'a>> {
let character_category = CharacterCategory::from_file(character_category_file)?;
Ok(Self::from_system_dictionary_and_chardef(dictionary_bytes, character_category)?)
Ok(Self::from_system_dictionary_and_chardef(
dictionary_bytes,
character_category,
)?)
}

/// Creates a system dictionary from bytes, and load embedded default character category
pub fn from_system_dictionary_embedded(
dictionary_bytes: &'a [u8],
) -> SudachiResult<LoadedDictionary<'a>> {
let character_category = CharacterCategory::from_bytes(DEFAULT_CHAR_DEF_BYTES)?;
Ok(Self::from_system_dictionary_and_chardef(dictionary_bytes, character_category)?)
Ok(Self::from_system_dictionary_and_chardef(
dictionary_bytes,
character_category,
)?)
}

#[cfg(test)]
Expand Down

0 comments on commit ae095ab

Please sign in to comment.