top | item 42502249

(no title)

farresito | 1 year ago

As someone who is interested in getting more serious with Rust, could you explain the essence of how you should always approach organizing code in Rust as to minimize refactors as the code grows?

discuss

order

oconnor663|1 year ago

In my experience there are two versions of "fighting the borrow checker". The first is where the language has tools it needs you to use that you might not've seen before, like enums, Option::take, Arc/Mutex, channels, etc. The second is where you need to stop using references/lifetimes and start using indexes: https://jacko.io/object_soup.html

meindnoch|1 year ago

>and start using indexes

So basically raw pointers with extra hoops to jump through.