Hello Rust community!
I've been busying myself over the past few weeks learning the different
features of rust, and I have been working on an implementation of Conway's
game of life (while trying to explore different features of rust.
In 0.9, it was changed so that you cannot dereference
Something like this should work:
pub fn cell_alive(self, Row(row): Row, Column(column): Column) - uint {
return match self.inner[row][column].value {
dead = 0,
alive = 1
};
}
Steven Fackler
On Sat, Jan 11, 2014 at 2:03 PM, benjamin adamson
adamson.benja...@gmail.com wrote:
Thanks! That did work. However I have no idea what this is doing:
Row(row): Row, Column(column): Column
The way I understood variable declaration, is that it goes:
name : type.
What does wrapping the 'name' of the variable with it's type on the LHS of
the : as well as having it on the RHS? Is
What does wrapping the 'name' of the variable with it's type on the LHS of
the : as well as having it on the RHS?
It's a destructuring pattern, extracting the content of the Row/Column
values and binding a variable to it.
___
Rust-dev mailing list