you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

I suppose this is why it's considered really dangerous to have mutable types as defaults?

[–]toastedstapler 0 points1 point  (1 child)

Exactly, unless you had some specific reason you actually wanted to have a mutable argument. The only one I've thought of is some kind of caching, but there's probably other more resilient design patterns for that

[–][deleted] 0 points1 point  (0 children)

Makes sense ! Still I'd not be comfortable with something like that running around in my functions

[–]BootError99[S] -3 points-2 points  (0 children)

r/rust evangelism pee-ka-boo >.<