Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-ssr/src/matching.rs')
-rw-r--r--crates/ide-ssr/src/matching.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide-ssr/src/matching.rs b/crates/ide-ssr/src/matching.rs
index 060897a685..fb98e95684 100644
--- a/crates/ide-ssr/src/matching.rs
+++ b/crates/ide-ssr/src/matching.rs
@@ -456,7 +456,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
SyntaxElement::Token(t) => Some(t.clone()),
SyntaxElement::Node(n) => n.first_token(),
})
- .map(|p| p.text().to_string());
+ .map(|p| p.text().to_owned());
let first_matched_token = child.clone();
let mut last_matched_token = child;
// Read code tokens util we reach one equal to the next token from our pattern
@@ -706,7 +706,7 @@ where
// we are trying to match that bit of code. This saves us having to pass a boolean into all the bits
// of code that can make the decision to not match.
thread_local! {
- pub static RECORDING_MATCH_FAIL_REASONS: Cell<bool> = Cell::new(false);
+ pub static RECORDING_MATCH_FAIL_REASONS: Cell<bool> = const { Cell::new(false) };
}
fn recording_match_fail_reasons() -> bool {
@@ -795,7 +795,7 @@ mod tests {
let edits = match_finder.edits();
assert_eq!(edits.len(), 1);
let edit = &edits[&position.file_id];
- let mut after = input.to_string();
+ let mut after = input.to_owned();
edit.apply(&mut after);
assert_eq!(after, "fn foo() {} fn bar() {} fn main() { bar(1+2); }");
}