1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// String concatenation.
//
// Spliced into the `FluentIter` trait by `build.rs`. Names resolve in
// the crate-root scope of `lib.rs`, exactly as before the split.
/// ⇔ `.join(sep)`: display every item with the separator between.
/// (JS skips nullish items; Rust has neither, every item is shown.)
///
/// ```
/// use fluent_iterable::FluentIter;
///
/// assert_eq!([1, 2, 3].into_iter().join(", "), "1, 2, 3");
/// ```
/// ⇔ `.join(sep, mapFn)`: project each item before joining.
///
/// ```
/// use fluent_iterable::FluentIter;
///
/// let out = [1, 2].into_iter().join_by(|v| format!("{v:>3}"), "-");
/// assert_eq!(out, " 1- 2");
/// ```