mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -05:00
refactor(cli): Make room for ident dict
This commit is contained in:
parent
fd6873b6e0
commit
66a70abc40
1 changed files with 11 additions and 2 deletions
|
@ -20,9 +20,10 @@ impl BuiltIn {
|
||||||
|
|
||||||
pub fn correct_ident<'s>(
|
pub fn correct_ident<'s>(
|
||||||
&'s self,
|
&'s self,
|
||||||
_ident: typos::tokens::Identifier<'_>,
|
ident_token: typos::tokens::Identifier<'_>,
|
||||||
) -> Option<Status<'s>> {
|
) -> Option<Status<'s>> {
|
||||||
None
|
let ident = ident_token.token();
|
||||||
|
self.correct_ident_with_dict(ident)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn correct_word<'s>(&'s self, word_token: typos::tokens::Word<'_>) -> Option<Status<'s>> {
|
pub fn correct_word<'s>(&'s self, word_token: typos::tokens::Word<'_>) -> Option<Status<'s>> {
|
||||||
|
@ -50,6 +51,10 @@ impl BuiltIn {
|
||||||
|
|
||||||
#[cfg(feature = "dict")]
|
#[cfg(feature = "dict")]
|
||||||
impl BuiltIn {
|
impl BuiltIn {
|
||||||
|
fn correct_ident_with_dict<'s>(&self, _ident: &str) -> Option<Status<'s>> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
// Not using `Status` to avoid the allocations
|
// Not using `Status` to avoid the allocations
|
||||||
fn correct_word_with_dict(
|
fn correct_word_with_dict(
|
||||||
&self,
|
&self,
|
||||||
|
@ -61,6 +66,10 @@ impl BuiltIn {
|
||||||
|
|
||||||
#[cfg(not(feature = "dict"))]
|
#[cfg(not(feature = "dict"))]
|
||||||
impl BuiltIn {
|
impl BuiltIn {
|
||||||
|
fn correct_ident_with_dict<'s>(&self, _ident: &str) -> Option<Status<'s>> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
fn correct_word_with_dict(
|
fn correct_word_with_dict(
|
||||||
&self,
|
&self,
|
||||||
_word: unicase::UniCase<&str>,
|
_word: unicase::UniCase<&str>,
|
||||||
|
|
Loading…
Reference in a new issue