4 ms·
The difference is that Go's `defer` is explicitly written out in the relevant scope, while Rust's `Drop` is implicit and defined elsewhere.
by matt_kantor 9y ago
The difference is that Go's `defer` is explicitly written out in the relevant scope, while Rust's `Drop` is implicit and defined elsewhere.
- steveklabnik 9y agoThere's a "scopeguard" crate that uses Drop to make it explicit.