Created
September 14, 2016 13:35
-
-
Save anonymous/8470cd2fed01ac18bc2714895b6fae2a to your computer and use it in GitHub Desktop.
Rust code shared from the playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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