Skip to content

Comment on Perhaps Rust Needs "Defer"

Comments

I would totally use a Swift-style concise defer. Writing the idiomatic wrapper struct and implementing Drop is obtuse and repetitive. Both wrapper structs and the scopeguard macro approach have to be wasting compilation time.

I have a lot of FFI code paths that end up easier to understand if you use the C-style instead of the Rusty approach.

Readability and comp time should be important even in FFI code paths

AboutSource Built by g1lg1l

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