mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
parser: Fix warnings about clippy str_to_string
rule
This commit is contained in:
parent
edda6b8a1f
commit
f474bd77be
2 changed files with 3 additions and 3 deletions
|
@ -149,7 +149,7 @@ impl<'a> Converter<'a> {
|
|||
|
||||
if let Some(err) = err {
|
||||
let token = self.res.len() as u32;
|
||||
let msg = err.to_string();
|
||||
let msg = err.to_owned();
|
||||
self.res.error.push(LexError { msg, token });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,9 +60,9 @@ fn collect_tests(s: &str) -> Vec<Test> {
|
|||
for comment_block in sourcegen::CommentBlock::extract_untagged(s) {
|
||||
let first_line = &comment_block.contents[0];
|
||||
let (name, ok) = if let Some(name) = first_line.strip_prefix("test ") {
|
||||
(name.to_string(), true)
|
||||
(name.to_owned(), true)
|
||||
} else if let Some(name) = first_line.strip_prefix("test_err ") {
|
||||
(name.to_string(), false)
|
||||
(name.to_owned(), false)
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue