Skip to content

Commit ae78dca

Browse files
ide-ssr: Fix warnings about clippy str_to_string rule
1 parent fb8c0f5 commit ae78dca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/ide-ssr/src/matching.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
456456
SyntaxElement::Token(t) => Some(t.clone()),
457457
SyntaxElement::Node(n) => n.first_token(),
458458
})
459-
.map(|p| p.text().to_string());
459+
.map(|p| p.text().to_owned());
460460
let first_matched_token = child.clone();
461461
let mut last_matched_token = child;
462462
// Read code tokens util we reach one equal to the next token from our pattern
@@ -795,7 +795,7 @@ mod tests {
795795
let edits = match_finder.edits();
796796
assert_eq!(edits.len(), 1);
797797
let edit = &edits[&position.file_id];
798-
let mut after = input.to_string();
798+
let mut after = input.to_owned();
799799
edit.apply(&mut after);
800800
assert_eq!(after, "fn foo() {} fn bar() {} fn main() { bar(1+2); }");
801801
}

crates/ide-ssr/src/parsing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl FromStr for SsrRule {
152152
.next()
153153
.ok_or_else(|| SsrError("Cannot find delimiter `==>>`".into()))?
154154
.trim()
155-
.to_string();
155+
.to_owned();
156156
if it.next().is_some() {
157157
return Err(SsrError("More than one delimiter found".into()));
158158
}

0 commit comments

Comments
 (0)