4 ms·
You can solve this problem the Rust way too: don't use a constructor. Create a static `new` method that returns the object to you, with optional error flags. T
by Manishearth 11y ago
You can solve this problem the Rust way too: don't use a constructor. Create a static `new` method that returns the object to you, with optional error flags.
This is still RAII, you're just not using a constructor to acquire. Rust doesn't have constructors and is still RAII.