Skip to content

Instantly share code, notes, and snippets.

@philippkeller
Created September 28, 2016 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philippkeller/3f5f14a754723ceb18a0ee15eb801d8f to your computer and use it in GitHub Desktop.
Save philippkeller/3f5f14a754723ceb18a0ee15eb801d8f to your computer and use it in GitHub Desktop.
converts
fn array_to_string(slice:&[i8]) -> String {
slice.iter().take_while(|&x| *x != 0).map(|&a| a as u8 as char).join("")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment