Skip to content

Commit

Permalink
style: Address clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Page committed Mar 31, 2021
1 parent 8365351 commit d51725b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ impl EngineConfig {
tokenizer: Some(
empty
.tokenizer
.unwrap_or_else(|| TokenizerConfig::from_defaults()),
.unwrap_or_else(TokenizerConfig::from_defaults),
),
dict: Some(empty.dict.unwrap_or_else(|| DictConfig::from_defaults())),
dict: Some(empty.dict.unwrap_or_else(DictConfig::from_defaults)),
}
}

Expand Down
15 changes: 11 additions & 4 deletions src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ impl ConfigStorage {
self.arena
.lock()
.unwrap()
.alloc(kstring::KString::from_ref(other)),
.alloc(kstring::KString::from_ref(other))
.as_str(),
)
}
}
}

impl Default for ConfigStorage {
fn default() -> Self {
Self::new()
}
}

pub struct ConfigEngine<'s> {
storage: &'s ConfigStorage,

Expand Down Expand Up @@ -145,8 +152,8 @@ impl<'s> ConfigEngine<'s> {
tokenizer, dict, ..
} = default;
let tokenizer_config =
tokenizer.unwrap_or_else(|| crate::config::TokenizerConfig::from_defaults());
let dict_config = dict.unwrap_or_else(|| crate::config::DictConfig::from_defaults());
tokenizer.unwrap_or_else(crate::config::TokenizerConfig::from_defaults);
let dict_config = dict.unwrap_or_else(crate::config::DictConfig::from_defaults);

let tokenizer = typos::tokens::TokenizerBuilder::new()
.ignore_hex(tokenizer_config.ignore_hex())
Expand Down Expand Up @@ -177,7 +184,7 @@ impl<'s> ConfigEngine<'s> {
files,
check_filenames: check_filename,
check_files: check_file,
binary: binary,
binary,
tokenizer,
dict,
};
Expand Down

0 comments on commit d51725b

Please sign in to comment.