mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Remove some unneeded string allocations
This commit is contained in:
parent
a9814fa9c0
commit
816190c6f6
3 changed files with 5 additions and 3 deletions
|
@ -473,7 +473,9 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
|
|||
}
|
||||
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)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue