parser: Fix warnings about clippy str_to_string rule

This commit is contained in:
Tetsuharu Ohzeki 2024-02-10 00:50:44 +09:00
parent edda6b8a1f
commit f474bd77be
2 changed files with 3 additions and 3 deletions

View File

@ -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 });
}
}

View File

@ -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;
};