diff options
Diffstat (limited to 'src/example.rs')
-rw-r--r-- | src/example.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/example.rs b/src/example.rs index 494ab73..5881ebd 100644 --- a/src/example.rs +++ b/src/example.rs @@ -4,7 +4,11 @@ use crate::charset::Charset; use crate::*; impl Example { - pub fn gen_furigana(&mut self, dict_idx: &DictIndex, overrides: &HashMap<String, String>) -> bool { + pub fn gen_furigana( + &mut self, + dict_idx: &DictIndex, + overrides: &HashMap<String, String>, + ) -> bool { use std::fmt::Write; if let Some(v) = overrides.get(&self.ja) { @@ -49,10 +53,9 @@ impl Example { let reb = match reb { Some(reb) if reb.starts_with('#') => { let ents = dict_idx.get(keb).map(|x| &x[..]).unwrap_or_default(); - if let Some(ent) = ents - .iter() - .find(|ent| ent.ent_seq == reb.strip_prefix('#').unwrap().parse::<u64>().unwrap()) - { + if let Some(ent) = ents.iter().find(|ent| { + ent.ent_seq == reb.strip_prefix('#').unwrap().parse::<u64>().unwrap() + }) { ent.reb.as_str() } else { is_good = false; |