4 ms·
In Rust, unlike in garbage collected languages, you never1 explicitly close or release resources like files, sockets and locks GC languages is trying to emulat
by chaotic-good 12y ago
In Rust, unlike in garbage collected languages, you never1 explicitly close or release resources like files, sockets and locks
GC languages is trying to emulate machine with infinite memory so you don't need to bother yourself with _memory_ management. It's not compatible with rust's resource management system that manages resources and treats memory as another type of resource.
The same is true for C++ BTW, in good C++ code you never release resources by hand and use ownership for this (RAII).