fix: Naming; Lifetimes; deny(rust_2018_idioms)

- One has to think about lifetimes if a type has one:
  - `<&'a Node<'tree>>::language` now returns `Language<'tree>` instead of
    `Language<'a>`, as it should;
- Renamed `struct TreeCursor<'cursor>` into `struct TreeCursor<'tree>`,
  to be consistant with the usages and reduse confusion;
- Remove explicit "outlives" requirements from `QueryMatches`, `QueryCaptures`,
  and their impl blocks, because they're inferred
- TODO: should `'query` be renamed into `'cursor`?
This commit is contained in:
DanikVitek 2026-01-10 23:01:55 +02:00
parent 630fa52717
commit ffd777ba65
29 changed files with 169 additions and 158 deletions

View file

@ -4,7 +4,7 @@ use super::{scope_sequence::ScopeSequence, LOG_ENABLED, LOG_GRAPH_ENABLED};
use crate::util;
pub fn check_consistent_sizes(tree: &Tree, input: &[u8]) {
fn check(node: Node, line_offsets: &[usize]) {
fn check(node: Node<'_>, line_offsets: &[usize]) {
let start_byte = node.start_byte();
let end_byte = node.end_byte();
let start_point = node.start_position();