Skip to main content

csv

Function csv 

Source
pub fn csv<I, S>(values: I) -> Option<String>
where I: IntoIterator<Item = S>, S: ToString,
Expand description

Comma-joins a multi-value query parameter; None when the joined value is empty, so the parameter is omitted rather than sent empty.

assert_eq!(polyoxide_core::csv(["a", "b"]), Some("a,b".to_owned()));
assert_eq!(polyoxide_core::csv(Vec::<String>::new()), None);
assert_eq!(polyoxide_core::csv([""]), None);