test-utils: Fix warnings about clippy str_to_string rule

This commit is contained in:
Tetsuharu Ohzeki 2024-02-10 00:58:06 +09:00
parent 0a879f7da4
commit c3699b9f32
3 changed files with 20 additions and 20 deletions

View file

@ -164,7 +164,7 @@ pub fn extract_tags(mut text: &str, tag: &str) -> (Vec<(TextRange, Option<String
if text.starts_with(&open) {
let close_open = text.find('>').unwrap();
let attr = text[open.len()..close_open].trim();
let attr = if attr.is_empty() { None } else { Some(attr.to_string()) };
let attr = if attr.is_empty() { None } else { Some(attr.to_owned()) };
text = &text[close_open + '>'.len_utf8()..];
let from = TextSize::of(&res);
stack.push((from, attr));
@ -326,7 +326,7 @@ fn extract_line_annotations(mut line: &str) -> Vec<LineAnnotation> {
content = &content["file".len()..];
}
let content = content.trim_start().to_string();
let content = content.trim_start().to_owned();
let annotation = if continuation {
LineAnnotation::Continuation { offset: range.end(), content }