libpna 0.32.1

PNA(Portable-Network-Archive) decoding and encoding library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub(crate) fn join_with_capacity(
    mut iter: impl Iterator<Item = impl AsRef<str>>,
    sep: &str,
    capacity: usize,
) -> String {
    match iter.next() {
        None => String::new(),
        Some(first) => {
            let mut result = String::with_capacity(capacity);
            result.push_str(first.as_ref());
            for item in iter {
                result.push_str(sep);
                result.push_str(item.as_ref());
            }
            result
        }
    }
}