mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
test-utils: Fix warnings about clippy str_to_string
rule
This commit is contained in:
parent
0a879f7da4
commit
c3699b9f32
3 changed files with 20 additions and 20 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue