summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar memoryruins <memoryruinsmusic@gmail.com>2019-11-07 01:07:00 -0500
committerLibravatar memoryruins <memoryruinsmusic@gmail.com>2019-11-07 01:07:00 -0500
commitb9398d2df87ebcfb243a78290712c1ccff904171 (patch)
tree344cf5bf87f2984e457ba1d0576292503ce90519 /core
parentd568d05df4388bfaa254ee87cca6edd07fc24465 (diff)
downloadiced-b9398d2df87ebcfb243a78290712c1ccff904171.tar.gz
iced-b9398d2df87ebcfb243a78290712c1ccff904171.tar.bz2
iced-b9398d2df87ebcfb243a78290712c1ccff904171.zip
minor changes to text_input's use of iterators
Diffstat (limited to 'core')
-rw-r--r--core/src/widget/text_input.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/core/src/widget/text_input.rs b/core/src/widget/text_input.rs
index e5d6b70d..9c7f4bc8 100644
--- a/core/src/widget/text_input.rs
+++ b/core/src/widget/text_input.rs
@@ -125,17 +125,12 @@ impl Value {
}
pub fn until(&self, index: usize) -> Self {
- Self(self.0[..index.min(self.len())].iter().cloned().collect())
+ Self(self.0[..index.min(self.len())].to_vec())
}
pub fn to_string(&self) -> String {
- let mut string = String::new();
-
- for c in self.0.iter() {
- string.push(*c);
- }
-
- string
+ use std::iter::FromIterator;
+ String::from_iter(self.0.iter())
}
pub fn insert(&mut self, index: usize, c: char) {