Auto merge of #46485 - khuey:cursor-read_exact, r=Manishearth
Auto merge of #46485 - khuey:cursor-read_exact, r=Manishearth

Add a specialization of read_exact for Cursor.

The read_exact implementation for &[u8] is optimized and usually allows LLVM to reduce a read_exact call for small numbers of bytes to a bounds check and a register load instead of a generic memcpy.  On a workload I have that decompresses, deserializes (via bincode), and processes some data, this leads to a 40% speedup by essentially eliminating the deserialization overhead entirely.

GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust