about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>2024-02-10 00:49:00 +0900
committerTetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>2024-02-10 01:00:40 +0900
commitae78dcae75694f44bc46c508086fb9d025ece858 (patch)
tree229bef1727995dccbf3a43cc499f8cf148092515
parentfb8c0f514e066567a6f5800150b9a2910ce851fd (diff)
downloadrust-ae78dcae75694f44bc46c508086fb9d025ece858.tar.gz
rust-ae78dcae75694f44bc46c508086fb9d025ece858.zip
ide-ssr: Fix warnings about clippy `str_to_string` rule
-rw-r--r--crates/ide-ssr/src/matching.rs4
-rw-r--r--crates/ide-ssr/src/parsing.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide-ssr/src/matching.rs b/crates/ide-ssr/src/matching.rs
index 81f00d51a34..fb98e956847 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
@@ -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); }");
     }
diff --git a/crates/ide-ssr/src/parsing.rs b/crates/ide-ssr/src/parsing.rs
index d78d009681a..2f91271c465 100644
--- a/crates/ide-ssr/src/parsing.rs
+++ b/crates/ide-ssr/src/parsing.rs
@@ -152,7 +152,7 @@ impl FromStr for SsrRule {
             .next()
             .ok_or_else(|| SsrError("Cannot find delimiter `==>>`".into()))?
             .trim()
-            .to_string();
+            .to_owned();
         if it.next().is_some() {
             return Err(SsrError("More than one delimiter found".into()));
         }