chore: turbofish styling
This commit is contained in:
parent
99b93d83a1
commit
754aa62e89
3 changed files with 8 additions and 8 deletions
|
|
@ -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::<TokenSet>();
|
||||
|
||||
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::<TokenSet>();
|
||||
|
||||
// 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::<TokenSet>();
|
||||
|
||||
// Exclude keyword candidates for which substituting the keyword capture
|
||||
// token would introduce new lexical conflicts with other tokens.
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ pub(crate) struct GrammarJSON {
|
|||
}
|
||||
|
||||
pub(crate) fn parse_grammar(input: &str) -> Result<InputGrammar> {
|
||||
let grammar_json: GrammarJSON = serde_json::from_str(input)?;
|
||||
let grammar_json = serde_json::from_str::<GrammarJSON>(input)?;
|
||||
|
||||
let mut variables = Vec::with_capacity(grammar_json.rules.len());
|
||||
for (name, value) in grammar_json.rules {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue