Skip to content

Commit 66a70ab

Browse files
committed
refactor(cli): Make room for ident dict
1 parent fd6873b commit 66a70ab

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

crates/typos-cli/src/dict.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ impl BuiltIn {
2020

2121
pub fn correct_ident<'s>(
2222
&'s self,
23-
_ident: typos::tokens::Identifier<'_>,
23+
ident_token: typos::tokens::Identifier<'_>,
2424
) -> Option<Status<'s>> {
25-
None
25+
let ident = ident_token.token();
26+
self.correct_ident_with_dict(ident)
2627
}
2728

2829
pub fn correct_word<'s>(&'s self, word_token: typos::tokens::Word<'_>) -> Option<Status<'s>> {
@@ -50,6 +51,10 @@ impl BuiltIn {
5051

5152
#[cfg(feature = "dict")]
5253
impl BuiltIn {
54+
fn correct_ident_with_dict<'s>(&self, _ident: &str) -> Option<Status<'s>> {
55+
None
56+
}
57+
5358
// Not using `Status` to avoid the allocations
5459
fn correct_word_with_dict(
5560
&self,
@@ -61,6 +66,10 @@ impl BuiltIn {
6166

6267
#[cfg(not(feature = "dict"))]
6368
impl BuiltIn {
69+
fn correct_ident_with_dict<'s>(&self, _ident: &str) -> Option<Status<'s>> {
70+
None
71+
}
72+
6473
fn correct_word_with_dict(
6574
&self,
6675
_word: unicase::UniCase<&str>,

0 commit comments

Comments
 (0)