• harrowhawk@lemmy.sdf.org
    link
    fedilink
    arrow-up
    7
    arrow-down
    3
    ·
    15 hours 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.