});
for token in tokens {
if token.kind() == SyntaxKind::IDENT
- && token.to_string() == *name
+ && token.text() == name.as_str()
{
precise_location = Some(token.text_range());
break 'outer;
}
SyntaxElement::Node(n) => {
if let Some(first_token) = n.first_token() {
- if Some(first_token.to_string()) == next_pattern_token {
+ if Some(first_token.text().as_str())
+ == next_pattern_token.as_deref()
+ {
if let Some(SyntaxElement::Node(p)) = pattern.next() {
// We have a subtree that starts with the next token in our pattern.
self.attempt_match_token_tree(phase, &p, &n)?;