pub fn concat<I>(iter: I) -> Concat<I::IntoIter>where
I: IntoIterator,
I::IntoIter: Clone,
Expand description
Concatenates Iterator
items.
This is a non-allocating alternative to
[T]::concat()
.
If Clone
for the Iterator
is too expensive, consider using
concat_once()
.
Although this can be used to conditionally write an Option
(because it
implements IntoIterator
), consider using cond_option()
for this instead.
Examples
let value = fmty::concat(["hola", "mundo"]);
assert_eq!(value.to_string(), "holamundo");