The reason for the unsafe was presumably to avoid copying or zero-initializing. This achieves the same but using only safe functions. Note: there is no zero-initializing here because Cursor is "trusted" to not read from the buffer and so skips the initialization: https://github.com/rust-lang/rust/blob/master/src/libstd/io/cursor.rs#L241 (the Take wrapper delegates to its inner).pull/37/head
parent
3e02fe5351
commit
4cfe9a2be1
Loading…
Reference in new issue