cleaning up with match per suggestion

This commit is contained in:
Martin Lariz 2020-07-30 12:17:25 -07:00 committed by Ferran Basora
parent f4696faf77
commit 0e04276056

View File

@ -125,14 +125,11 @@ impl<'a> View<'a> {
); );
if let Some(ref hint) = mat.hint { if let Some(ref hint) = mat.hint {
let extra_position = if self.position == "left" { let extra_position = match self.position {
0 "right" => text.len() - mat.hint.clone().unwrap().len(),
} else if self.position == "off_left" { "off_left" => 0 - mat.hint.clone().unwrap().len(),
0 - mat.hint.clone().unwrap().len() "off_right" => text.len(),
} else if self.position == "off_right" { _ => 0,
text.len()
} else {
text.len() - mat.hint.clone().unwrap().len()
}; };
let text = self.make_hint_text(hint.as_str()); let text = self.make_hint_text(hint.as_str());