Function fmty::csv_map_once

source ·
pub fn csv_map_once<I, R, F>(iter: I, f: F) -> CsvMapOnce<I::IntoIter, F>where
    I: IntoIterator,
    F: Fn(I::Item) -> R,
Expand description

Concatenates mapped Iterator results with , between each, at most once.

Examples

let value = fmty::csv_map_once(["hola", "mundo"], fmty::to_ascii_uppercase);
assert_eq!(value.to_string(), "HOLA, MUNDO");

assert_eq!(value.to_string(), "");