diff options
author | 2019-11-08 00:54:05 +0100 | |
---|---|---|
committer | 2019-11-08 00:54:05 +0100 | |
commit | b31a80f2c0ca198f1bf0206618654415d2da460e (patch) | |
tree | 2be68f0a5f5a7c8d5ba9734417de4c69a9f83857 /core | |
parent | 59ef7f074c67126dd8bd0ae9cbc82ce2a946258f (diff) | |
parent | 786ac31c0264b2525f28717d70ee4a66c9d2e581 (diff) | |
download | iced-b31a80f2c0ca198f1bf0206618654415d2da460e.tar.gz iced-b31a80f2c0ca198f1bf0206618654415d2da460e.tar.bz2 iced-b31a80f2c0ca198f1bf0206618654415d2da460e.zip |
Merge pull request #45 from memoryruins/smol-changes
Minor clean-up
Diffstat (limited to 'core')
-rw-r--r-- | core/src/widget/text_input.rs | 11 |
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) { |