Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe more interestingly, line 659, slightly above that, explains that we know we got [u8] but today the ordinary Rust allocator promises capacity is correct, so we just ignore the length of that slice.

We could, as that comment suggests, check the slice and see if there's enough room for more than our chosen capacity. We could also debug_assert that it's not less room, 'cos the Allocator promised it would be big enough. I dunno if that's worthwhile.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: