Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2016 09:33
Show Gist options
  • Save anonymous/8521121d0d0c9557ad111f385d81bd2e to your computer and use it in GitHub Desktop.
Save anonymous/8521121d0d0c9557ad111f385d81bd2e to your computer and use it in GitHub Desktop.
Shared via Rust Playground
fn main() {
let floats = vec![1.0, 2.0, 3.0];
let s: &[f64] = &floats[..];
let string = s.into_iter().map(ToString::to_string).collect::<Vec<_>>().join(",");
println!("{}", string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment