1. 9
    Arrays in Rust
    1m 41s

Arrays in Rust

InstructorPascal Precht

Share this video with your friends

Send Tweet

In this lesson we take a look at Arrays and the different ways of creating them. Arrays in Rust are collections of values of the same type that cannot change in size. In other words, the number of fields (or elements) has to be known at compile time.

J. Matthew
~ 4 years ago

for number in &numbers {

Why did you use a reference to the array?

When I try it without the ampersand, I get a compile error that the array is not an iterator.

Pascal Prechtinstructor
~ 4 years ago

This needs a blog post. I'll put one together and post it here once done.

Anthony Albertorio
~ 4 years ago

Is the blog up? I have the same question.

Pascal Prechtinstructor
~ 4 years ago

Hey Anthony,

unfortunately I didn't get to writing it yet. Life happened, ha. But thanks for the reminder!

Rene
~ 3 years ago

hi Pascal, is the blog finished ? is that &names for leaving the ownership in the array ? or it is for performance ?