News for hackers. Stuff that matters.
Re:Identifying Rust's collect:<Vec<_>>() memory leak footgun by invpt on Thursday January 18, 2024 @02:34PM (#39046488)
If you look at the source for into_boxed_slice, it calls shrink_to_fit at the beginning before doing anything else. Hence the documentation is slightly wrong, and no copies occur.

Edit: I submitted a PR to clear up the docs: https://github.com/rust-lang/rust/pull/120110

Re:Identifying Rust's collect:<Vec<_>>() memory leak footgun by cmrx64 on Thursday January 18, 2024 @04:30PM (#39048035)
thank you!