refactor: remove redundant to_owned

This commit is contained in:
2021-07-09 19:11:11 -04:00
parent e31f36b8aa
commit 0e77136f14

View File

@@ -57,10 +57,8 @@ fn get_todos(path: &str, todos: &mut Vec<String>) -> Result<(), std::io::Error>
for line in contents.lines() {
if line.contains("TODO") {
let (_, comment) = line.split_once("TODO").unwrap();
let cleaned_comment = comment.replace(":", "")
.trim()
.to_owned();
todos.push(cleaned_comment.to_owned())
let cleaned_comment = comment.replace(":", "").trim().to_owned();
todos.push(cleaned_comment)
}
}