Skip to content

Comment on Perhaps Rust Needs "Defer"parent

Comments

What we want everywhere is block-scoped defer, right?

Not always. Block-scoped defer makes allocating inside "if blocks" a pain.

The flip side is that function-scoped is a pain to implement in a non-GC language.

AboutSource Built by g1lg1l

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