summaryrefslogtreecommitdiffstats
path: root/widget/src/text_input/value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'widget/src/text_input/value.rs')
-rw-r--r--widget/src/text_input/value.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/widget/src/text_input/value.rs b/widget/src/text_input/value.rs
index d1b056c8..46a1f754 100644
--- a/widget/src/text_input/value.rs
+++ b/widget/src/text_input/value.rs
@@ -89,11 +89,6 @@ impl Value {
Self { graphemes }
}
- /// Converts the [`Value`] into a `String`.
- pub fn to_string(&self) -> String {
- self.graphemes.concat()
- }
-
/// Inserts a new `char` at the given grapheme `index`.
pub fn insert(&mut self, index: usize, c: char) {
self.graphemes.insert(index, c.to_string());
@@ -131,3 +126,9 @@ impl Value {
}
}
}
+
+impl std::fmt::Display for Value {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.write_str(&self.graphemes.concat())
+ }
+}