From 754aa62e894b1a24fc1bc77465df9a2bf5e4a36e Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 16 Mar 2024 20:11:07 -0400 Subject: [PATCH] chore: turbofish styling --- cli/src/generate/build_tables/mod.rs | 12 ++++++------ cli/src/generate/parse_grammar.rs | 2 +- cli/src/tests/tags_test.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/src/generate/build_tables/mod.rs b/cli/src/generate/build_tables/mod.rs index a87afefd..edb13cac 100644 --- a/cli/src/generate/build_tables/mod.rs +++ b/cli/src/generate/build_tables/mod.rs @@ -97,7 +97,7 @@ fn populate_error_state( // First identify the *conflict-free tokens*: tokens that do not overlap with // any other token in any way, besides matching exactly the same string. - let conflict_free_tokens: TokenSet = (0..n) + let conflict_free_tokens = (0..n) .filter_map(|i| { let conflicts_with_other_tokens = (0..n).any(|j| { j != i @@ -114,7 +114,7 @@ fn populate_error_state( Some(Symbol::terminal(i)) } }) - .collect(); + .collect::(); let recover_entry = ParseTableEntry { reusable: false, @@ -263,7 +263,7 @@ fn identify_keywords( // First find all of the candidate keyword tokens: tokens that start with // letters or underscore and can match the same string as a word token. - let keyword_candidates: TokenSet = lexical_grammar + let keyword_candidates = lexical_grammar .variables .iter() .enumerate() @@ -282,10 +282,10 @@ fn identify_keywords( None } }) - .collect(); + .collect::(); // Exclude keyword candidates that shadow another keyword candidate. - let keywords: TokenSet = keyword_candidates + let keywords = keyword_candidates .iter() .filter(|token| { for other_token in keyword_candidates.iter() { @@ -302,7 +302,7 @@ fn identify_keywords( } true }) - .collect(); + .collect::(); // Exclude keyword candidates for which substituting the keyword capture // token would introduce new lexical conflicts with other tokens. diff --git a/cli/src/generate/parse_grammar.rs b/cli/src/generate/parse_grammar.rs index 5a52b346..356536e5 100644 --- a/cli/src/generate/parse_grammar.rs +++ b/cli/src/generate/parse_grammar.rs @@ -92,7 +92,7 @@ pub(crate) struct GrammarJSON { } pub(crate) fn parse_grammar(input: &str) -> Result { - let grammar_json: GrammarJSON = serde_json::from_str(input)?; + let grammar_json = serde_json::from_str::(input)?; let mut variables = Vec::with_capacity(grammar_json.rules.len()); for (name, value) in grammar_json.rules { diff --git a/cli/src/tests/tags_test.rs b/cli/src/tests/tags_test.rs index 6139f732..a6a2d135 100644 --- a/cli/src/tests/tags_test.rs +++ b/cli/src/tests/tags_test.rs @@ -398,7 +398,7 @@ fn test_tags_via_c_api() { .unwrap(); let syntax_types = unsafe { - let mut len: u32 = 0; + let mut len = 0; let ptr = c::ts_tagger_syntax_kinds_for_scope_name(tagger, c_scope_name.as_ptr(), &mut len); slice::from_raw_parts(ptr, len as usize)