parser: Fix warnings about clippy str_to_string
rule
This commit is contained in:
parent
edda6b8a1f
commit
f474bd77be
@ -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…
x
Reference in New Issue
Block a user