3 ms·
Really enjoyed seeing this broken down and explained. Is a function like that considered idiomatic Rust?
by csears 6y ago
Really enjoyed seeing this broken down and explained. Is a function like that considered idiomatic Rust?
- steveklabnik 6y agoYep! See my comment about the lifetimes, though, you may not actually write them out in the real code, but conceptually, this is Rust's bread and butter.
- stack_underflow 6y agoI'm learning Rust for the first time and found that The Rust Book does a pretty good job of covering language concepts. I actually just finished reading the section on lifetimes last night: https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html My experience so far with Rust has been a huge reduction in mental burden/bookkeeping compared to when I write modern C++.