Advertisement
cwchen

[Rust] Storing data into an array.

Aug 22nd, 2017
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.19 KB | None | 0 0
  1. fn main() {
  2.     let mut array = [0; 3];
  3.  
  4.     array[0] = 1;
  5.     array[1] = 2;
  6.     array[2] = 3;
  7.  
  8.     assert_eq!(array[0], 1);
  9.     assert_eq!(array[1], 2);
  10.     assert_eq!(array[2], 3);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement