summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/eco_string.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/eco_string.rs b/src/util/eco_string.rs
index 953508ce..e3c8fc8a 100644
--- a/src/util/eco_string.rs
+++ b/src/util/eco_string.rs
@@ -366,6 +366,16 @@ impl From<EcoString> for String {
}
}
+impl FromIterator<char> for EcoString {
+ fn from_iter<T: IntoIterator<Item = char>>(iter: T) -> Self {
+ let mut s = Self::new();
+ for c in iter {
+ s.push(c);
+ }
+ s
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;