From 68c5f52e94f1cd14c1bddfdee9deb4512ed75d06 Mon Sep 17 00:00:00 2001 From: Peter Bartyik Date: Mon, 13 Jul 2020 16:31:37 +0200 Subject: [PATCH] no need for string, line already string slice --- src/view.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/view.rs b/src/view.rs index a2b2e0b..5b78097 100644 --- a/src/view.rs +++ b/src/view.rs @@ -89,9 +89,7 @@ impl<'a> View<'a> { let clean = line.trim_end_matches(|c: char| c.is_whitespace()); if !clean.is_empty() { - let text = line.to_string(); - - print!("{goto}{text}", goto = cursor::Goto(1, index as u16 + 1), text = &text); + print!("{goto}{text}", goto = cursor::Goto(1, index as u16 + 1), text = line); } }