Re:Pre-Pooping Your Pants with Rust
by mcguire on Monday April 27, 2015 @11:21AM
(#9446851)
Largely unrelated question: In the code about a third of the way into the article, there is,
What does the line "self.0 += 1;" do? Specifically, the ".0"? Foo is a basically a reference to an i32, so I would have thought that would be "self += 1;".
[ Parent
| on HN ]
Re:Pre-Pooping Your Pants with Rust
by steveklabnik on Monday April 27, 2015 @11:35AM
(#9446939)
The .0 is a tuple access. Foo is a 'tuple struct' of length 1: http://doc.rust-lang.org/nightly/book/tuple-structs.html (though the syntax is explained in the section on tuples: http://doc.rust-lang.org/nightly/book/primitive-types.html#t... )