Skip to content

Comment on A guide to closures in Rustparent

Comments

When you are using the function, ye. Not when you are writing it. And if you someday want to change a const method to non-const you could have a cascading constness change all over the place.

But usually functions are used more than once.

"cascading constness change"

Which is good because invoking code may rely on function being read-only.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.