From 779b2d572f387cd37d28eefd940fc69fbf6da99b Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sat, 19 Dec 2020 21:45:09 +0100 Subject: [PATCH] fix clippy and unittest --- src/components/textinput.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/textinput.rs b/src/components/textinput.rs index f8b7c6c4..a0c471d0 100644 --- a/src/components/textinput.rs +++ b/src/components/textinput.rs @@ -170,7 +170,7 @@ impl TextInputComponent { txt = text_append( txt, Text::styled( - substitute.clone(), + substitute.to_owned(), self.theme .text(false, false) .add_modifier(Modifier::UNDERLINED), @@ -413,8 +413,8 @@ mod tests { "", ); let theme = SharedTheme::default(); - let underlined = theme - .text(true, false) + let underlined_whitespace = theme + .text(false, false) .add_modifier(Modifier::UNDERLINED); let not_underlined = Style::default(); @@ -430,8 +430,11 @@ mod tests { get_style(&txt.lines[0].0[0]), Some(¬_underlined) ); - assert_eq!(get_text(&txt.lines[0].0[1]), Some(" ")); - assert_eq!(get_style(&txt.lines[0].0[1]), Some(&underlined)); + assert_eq!(get_text(&txt.lines[0].0[1]), Some("\u{00B7}")); + assert_eq!( + get_style(&txt.lines[0].0[1]), + Some(&underlined_whitespace) + ); } #[test]