3 ms·
> If you have a polymorphic async function, then return your result in a Box. Agreed. Copy, Clone, Box, Arc, RwLock, etc. are your friends. Don't be afraid t
by bsder 4y ago
> If you have a polymorphic async function, then return your result in a Box.
Agreed. Copy, Clone, Box, Arc, RwLock, etc. are your friends. Don't be afraid to use them.
You don't need as much performance as you think you do. Passing things around on the heap is fine for most applications. The Rust compiler is often smarter than you think.
And, when the Rust compiler is dumb or your code is getting stuck, you have code that you can understand and find the hotspot of. Now you can be clever.