Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Writing into Uninitialized Buffers in Rust. Parent comment
let mut data = Vec::with_capacity(sz); data.extend(&buf[..sz]);
And from the doc:
> This implementation is specialized for slice iterators, where it uses copy_from_slice to append the entire slice at once.
Of course this trivial example could also be written as:
let mut data = buf.clone();
There are no comments on this comment yet.
And from the doc:
> This implementation is specialized for slice iterators, where it uses copy_from_slice to append the entire slice at once.
Of course this trivial example could also be written as: