aboutsummaryrefslogtreecommitdiff
path: root/crates/ssr/src/matching.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-31 09:14:22 +0000
committerGitHub <[email protected]>2020-12-31 09:14:22 +0000
commita90bc53df78852e4273477acffa14198a2408815 (patch)
tree6db96b8fceda3e68f63b4302f76b901786809704 /crates/ssr/src/matching.rs
parenta9814fa9c037b0fafd30580a6e7682ed032d77e6 (diff)
parent816190c6f6838f163acc4bbe6a06c302c99535b2 (diff)
Merge #7104
7104: Remove some unneeded string allocations r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ssr/src/matching.rs')
-rw-r--r--crates/ssr/src/matching.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ssr/src/matching.rs b/crates/ssr/src/matching.rs
index 99b187311..6cf831431 100644
--- a/crates/ssr/src/matching.rs
+++ b/crates/ssr/src/matching.rs
@@ -473,7 +473,9 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
473 } 473 }
474 SyntaxElement::Node(n) => { 474 SyntaxElement::Node(n) => {
475 if let Some(first_token) = n.first_token() { 475 if let Some(first_token) = n.first_token() {
476 if Some(first_token.to_string()) == next_pattern_token { 476 if Some(first_token.text().as_str())
477 == next_pattern_token.as_deref()
478 {
477 if let Some(SyntaxElement::Node(p)) = pattern.next() { 479 if let Some(SyntaxElement::Node(p)) = pattern.next() {
478 // We have a subtree that starts with the next token in our pattern. 480 // We have a subtree that starts with the next token in our pattern.
479 self.attempt_match_token_tree(phase, &p, &n)?; 481 self.attempt_match_token_tree(phase, &p, &n)?;