Skip to content

Instantly share code, notes, and snippets.

@philippkeller
Forked from anonymous/playground.rs
Last active September 14, 2016 13:36
Show Gist options
  • Save philippkeller/73ea01dd02e178a9e3b16ae492cd81f1 to your computer and use it in GitHub Desktop.
Save philippkeller/73ea01dd02e178a9e3b16ae492cd81f1 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
/// merges an array with ordinal numbers into a string
extern crate itertools;
use itertools::Itertools;
fn join_int_slice(slice:&[u8]) -> String {
slice.iter().map(|&a| a as char).join("")
}
fn main() {
let a = [70,90,80];
println!("{}", join_int_slice(&a));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment