diff options
author | Alan Somers <asomers@gmail.com> | 2017-11-04 14:48:14 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2018-01-15 21:50:01 -0700 |
commit | 631e3f30f6ed58596efec58a286bad75fee482de (patch) | |
tree | 88bf29ea85ade9eb8e09bf22894e2cd494232383 /src/lib.rs | |
parent | 93b85d8b70b14c49a983a6ab94cec6154bb209ef (diff) | |
download | nix-631e3f30f6ed58596efec58a286bad75fee482de.zip |
aio: use `Bytes` instead of `Rc<[u8]>`
It's not actually safe to read into an `Rc<[u8]>`. It only worked
because of a coincidental `unsafe` block. Replace that type with
`BytesMut` from the bytes crate. For consistency's sake, use `Bytes`
for writing too, and completely remove methods relating to `Rc<[u8]>`.
Note that the `AioCb` will actually own the `BytesMut` object. The
caller must call `into_buffer` to get it back once the I/O is complete.
Fixes #788
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -11,6 +11,7 @@ #![cfg_attr(test, deny(warnings))] #![recursion_limit = "500"] +extern crate bytes; #[macro_use] extern crate bitflags; |