From 0e77136f1424b225ffdde28d54f910cd7ac99584 Mon Sep 17 00:00:00 2001 From: Giovani Date: Fri, 9 Jul 2021 19:11:11 -0400 Subject: [PATCH] refactor: remove redundant to_owned --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 24f40fd..8655505 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,10 +57,8 @@ fn get_todos(path: &str, todos: &mut Vec) -> 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) } }