Created
March 23, 2017 17:22
-
-
Save pelengami/e5c36415f2f8b6c5a30def77f0e1879a to your computer and use it in GitHub Desktop.
This file contains 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
pub fn clone_into_array<A, T>(slice: &[T]) -> A | |
where A: Sized + Default + AsMut<[T]>, | |
T: Clone | |
{ | |
let mut arr = Default::default(); | |
<A as AsMut<[T]>>::as_mut(&mut arr).clone_from_slice(slice); | |
arr | |
} | |
pub fn shuffle_create_new<T: Clone>(vec: &[T]) -> Vec<T> { | |
let mut new_vec = vec.to_vec(); | |
//# shuffle | |
new_vec | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment