News for hackers. Stuff that matters.
Re:Gnirehtet rewritten in Rust by fnord123 on Monday September 25, 2017 @05:55AM (#15329121)
Is the purpose of encapsulation to wrap all data fields in functions offering mutable references to data? I thought it was the exact opposite.
Re:Gnirehtet rewritten in Rust by rom1v on Monday September 25, 2017 @06:05AM (#15329177)
The purpose was to show that something lifetime-bound to a part of a struct becomes lifetime-bound to the whole struct when returned from a function.

Using mutable references is the minimal way to get this.