arr-rs 0.6.0

arr-rs - rust arrays library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::str::Chars;

pub(crate) trait CharsJoin {

    fn join(&mut self, sep: &str) -> String;
}

impl CharsJoin for Chars<'_> {

    fn join(&mut self, sep: &str) -> String {
        self.fold(String::new(), |mut acc, c| {
            if !acc.is_empty() { acc.push_str(sep); }
            acc.push(c);
            acc
        })
    }
}