[-] kamikazerusher@lemmy.world 3 points 1 week ago

So do you do a lot of PCP?

[-] kamikazerusher@lemmy.world 3 points 1 week ago

I didn’t even know it came in liquid form!

[-] kamikazerusher@lemmy.world 5 points 2 weeks ago

The last two points are the kind of design advice I need to see. I’m probably so used to the C/C++ concept of passing by reference to prevent copies of complex data being generated that I forget how Rust’s definition of a reference is different.

[-] kamikazerusher@lemmy.world 4 points 2 weeks ago

Eh, I’m not entirely sold on that idea.

I think they do a good job of pointing out “this is a behavior/feature of Rust you need to understand.” However they can send you down the wrong path of correction.

The compiler error mentioning static lifetime specifiers of &str demonstrates both. It indicates to the developer that ownership and scopes will play a significant role when defining and accessing data. The error though will guide them towards researching how to define static lifetimes and possibly believe that they will need to set this in their functions and structs. Each time you look at questions about this error in places like Stack Overflow with example code you’ll find suggested solutions explaining that a manually-defined static lifetime isn’t necessary to resolve the problem.

[-] kamikazerusher@lemmy.world 19 points 2 weeks ago

This is my experience every time I return to learning rust. I’m guessing that if I used it more often than once a quarter with hobby projects I’d stop falling into the same traps.

[-] kamikazerusher@lemmy.world 1 points 3 weeks ago

Ok, I did not expect that ending

kamikazerusher

joined 2 years ago