Skip to content

Commit

Permalink
Lint against .to_string() on String
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed May 7, 2024
1 parent 9474635 commit 03d1f9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 0 additions & 1 deletion src/parse/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down

0 comments on commit 03d1f9b

Please sign in to comment.