Advertisement
cwchen

[Rust] Creating a slice.

Aug 22nd, 2017
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.15 KB | None | 0 0
  1. fn main() {
  2.     /* Internally, it works as this:
  3.        let _slice = [1, 2, 3, 4, 5];
  4.        let slice = &_slice; */
  5.     let slice = &[1, 2, 3, 4, 5];
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement