News for hackers. Stuff that matters.
Re:Should Small Rust Structs be Passed by-copy or by-borrow? by ok123456 on Saturday December 31, 2022 @02:09PM (#34199629)
This is true for application code. But, Rust is trying to sell itself as a systems language and an embedded language and a language you can write kernel modules in. Memory budget matters in these cases.
Re:Should Small Rust Structs be Passed by-copy or by-borrow? by tialaramex on Saturday December 31, 2022 @02:37PM (#34199888)
If memory budget matters, you have a memory budget. So you should be measuring and you can actually tell where you need improvements.

But in practice what we see overwhelmingly is that people want to do this stuff but they aren't measuring, because measuring is boring whereas making the code more complicated to show off how much you think you know about optimisation is easy. Knock it off.

Re:Should Small Rust Structs be Passed by-copy or by-borrow? by ok123456 on Saturday December 31, 2022 @02:44PM (#34199966)
Then knock off trying to use Rust as a systems language. Linear types make refactoring this nearly impossible if it does become and issue.
Re:Should Small Rust Structs be Passed by-copy or by-borrow? by tialaramex on Saturday December 31, 2022 @02:58PM (#34200113)
Works really nice for me, of course, I actually measure what I'm doing.

You edited your comment, so I guess I will too: Rust doesn't actually have Linear types. Linear types ("must use or compile error") would be tricky to provide, Aria blogged about it back in the day. So that's definitely going to be a problem with your refactoring.