Implement flexible TextInput::draw helper

This commit is contained in:
Héctor Ramón Jiménez 2020-11-17 05:13:06 +01:00
parent 62295f554b
commit df712f9ccf
2 changed files with 63 additions and 30 deletions

View file

@ -21,6 +21,15 @@ impl Value {
Self { graphemes }
}
/// Returns whether the [`Value`] is empty or not.
///
/// A [`Value`] is empty when it contains no graphemes.
///
/// [`Value`]: struct.Value.html
pub fn is_empty(&self) -> bool {
self.len() == 0
}
/// Returns the total amount of graphemes in the [`Value`].
///
/// [`Value`]: struct.Value.html