harrowhawk

joined 2 years ago
[–] harrowhawk@lemmy.sdf.org 5 points 1 month ago

I like this rule of thumb and it goes nicely with the “if you have more than 3 arguments to a function, consider making a struct to pass the arguments in” rule of thumb because

You can have the struct use a named lifetime (or several) for the different parameters so it doesn’t own them!

Best of both worlds.