mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
ide-db: Fix warnings about clippy str_to_string
rule
This commit is contained in:
parent
f4a4b6681b
commit
fb8c0f514e
2 changed files with 3 additions and 3 deletions
|
@ -203,7 +203,7 @@ mod tests {
|
||||||
use expect_test::{expect, Expect};
|
use expect_test::{expect, Expect};
|
||||||
|
|
||||||
fn check(input: &str, expect: &Expect) {
|
fn check(input: &str, expect: &Expect) {
|
||||||
let (output, exprs) = parse_format_exprs(input).unwrap_or(("-".to_string(), vec![]));
|
let (output, exprs) = parse_format_exprs(input).unwrap_or(("-".to_owned(), vec![]));
|
||||||
let outcome_repr = if !exprs.is_empty() {
|
let outcome_repr = if !exprs.is_empty() {
|
||||||
format!("{output}; {}", with_placeholders(exprs).join(", "))
|
format!("{output}; {}", with_placeholders(exprs).join(", "))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -52,7 +52,7 @@ pub struct LintGroup {
|
||||||
generate_lint_descriptor(sh, &mut contents);
|
generate_lint_descriptor(sh, &mut contents);
|
||||||
contents.push('\n');
|
contents.push('\n');
|
||||||
|
|
||||||
let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_string());
|
let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_owned());
|
||||||
let unstable_book = project_root().join("./target/unstable-book-gen");
|
let unstable_book = project_root().join("./target/unstable-book-gen");
|
||||||
cmd!(
|
cmd!(
|
||||||
sh,
|
sh,
|
||||||
|
@ -283,7 +283,7 @@ fn generate_descriptor_clippy(buf: &mut String, path: &Path) {
|
||||||
let line = &line[..up_to];
|
let line = &line[..up_to];
|
||||||
|
|
||||||
let clippy_lint = clippy_lints.last_mut().expect("clippy lint must already exist");
|
let clippy_lint = clippy_lints.last_mut().expect("clippy lint must already exist");
|
||||||
clippy_lint.help = unescape(line).trim().to_string();
|
clippy_lint.help = unescape(line).trim().to_owned();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clippy_lints.sort_by(|lint, lint2| lint.id.cmp(&lint2.id));
|
clippy_lints.sort_by(|lint, lint2| lint.id.cmp(&lint2.id));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue