Skip to content

Commit 779b2d5

Browse files
author
Stephan Dilly
committed
fix clippy and unittest
1 parent 3ff77e0 commit 779b2d5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/components/textinput.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl TextInputComponent {
170170
txt = text_append(
171171
txt,
172172
Text::styled(
173-
substitute.clone(),
173+
substitute.to_owned(),
174174
self.theme
175175
.text(false, false)
176176
.add_modifier(Modifier::UNDERLINED),
@@ -413,8 +413,8 @@ mod tests {
413413
"",
414414
);
415415
let theme = SharedTheme::default();
416-
let underlined = theme
417-
.text(true, false)
416+
let underlined_whitespace = theme
417+
.text(false, false)
418418
.add_modifier(Modifier::UNDERLINED);
419419

420420
let not_underlined = Style::default();
@@ -430,8 +430,11 @@ mod tests {
430430
get_style(&txt.lines[0].0[0]),
431431
Some(&not_underlined)
432432
);
433-
assert_eq!(get_text(&txt.lines[0].0[1]), Some(" "));
434-
assert_eq!(get_style(&txt.lines[0].0[1]), Some(&underlined));
433+
assert_eq!(get_text(&txt.lines[0].0[1]), Some("\u{00B7}"));
434+
assert_eq!(
435+
get_style(&txt.lines[0].0[1]),
436+
Some(&underlined_whitespace)
437+
);
435438
}
436439

437440
#[test]

0 commit comments

Comments
 (0)