Fix function calls
This commit is contained in:
@@ -31,7 +31,7 @@ impl<'s> Ptr<'s> {
|
||||
/// For example, 0 will return the current token, 1 will return the next, etc.
|
||||
pub fn nth(&self, n: u32) -> Option<char> {
|
||||
let mut chars = self.chars().peekable();
|
||||
chars.by_ref().skip(n as usize).next()
|
||||
chars.by_ref().nth(n as usize)
|
||||
}
|
||||
|
||||
/// Checks whether the current character is `c`.
|
||||
|
||||
@@ -135,7 +135,7 @@ fn find_reparsable_node(
|
||||
}
|
||||
|
||||
fn is_balanced(tokens: &[Token]) -> bool {
|
||||
if tokens.len() == 0
|
||||
if tokens.is_empty()
|
||||
|| tokens.first().unwrap().kind != L_CURLY
|
||||
|| tokens.last().unwrap().kind != R_CURLY
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::fmt::Write;
|
||||
|
||||
/// Parse a file and create a string representation of the resulting parse tree.
|
||||
pub fn dump_tree(syntax: SyntaxNodeRef) -> String {
|
||||
let mut errors: Vec<_> = syntax.root_data().iter().cloned().collect();
|
||||
let mut errors: Vec<_> = syntax.root_data().to_vec();
|
||||
errors.sort_by_key(|e| e.offset);
|
||||
let mut err_pos = 0;
|
||||
let mut level = 0;
|
||||
|
||||
Reference in New Issue
Block a user