2022-05-31 06:35:41 -05:00
|
|
|
// Regression test for #71546.
|
2022-06-15 07:46:19 -05:00
|
|
|
//
|
|
|
|
// Made to pass as part of fixing #98095.
|
|
|
|
//
|
2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
2022-05-31 06:35:41 -05:00
|
|
|
|
|
|
|
pub fn serialize_as_csv<V>(value: &V) -> Result<String, &str>
|
|
|
|
where
|
|
|
|
V: 'static,
|
|
|
|
for<'a> &'a V: IntoIterator,
|
|
|
|
for<'a> <&'a V as IntoIterator>::Item: ToString + 'static,
|
|
|
|
{
|
2022-06-15 07:46:19 -05:00
|
|
|
let csv_str: String = value.into_iter().map(|elem| elem.to_string()).collect::<String>();
|
2022-05-31 06:35:41 -05:00
|
|
|
Ok(csv_str)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|