Lint against .to_string() on String

pull/652/head^2
Wilfred Hughes 2024-05-07 08:39:07 +07:00
parent 9474635076
commit 03d1f9bf26
2 changed files with 2 additions and 1 deletions

@ -21,6 +21,8 @@
#![allow(clippy::mutable_key_type)]
// .to_owned() is more explicit on string references.
#![warn(clippy::str_to_string)]
// .to_string() on a String is clearer as .clone().
#![warn(clippy::string_to_string)]
// Debugging features shouldn't be in checked-in code.
#![warn(clippy::todo)]
#![warn(clippy::dbg_macro)]

@ -414,7 +414,6 @@ fn set_content_id(nodes: &[&Syntax], existing: &mut DftHashMap<ContentKey, u32>)
.map(|l| l.trim_start())
.collect::<Vec<_>>()
.join("\n")
.to_string()
} else {
content.clone()
};