summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2017-11-04 14:48:14 -0600
committerAlan Somers <asomers@gmail.com>2018-01-15 21:50:01 -0700
commit631e3f30f6ed58596efec58a286bad75fee482de (patch)
tree88bf29ea85ade9eb8e09bf22894e2cd494232383 /src/lib.rs
parent93b85d8b70b14c49a983a6ab94cec6154bb209ef (diff)
downloadnix-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.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8a63c072..5e37dec2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,6 +11,7 @@
#![cfg_attr(test, deny(warnings))]
#![recursion_limit = "500"]
+extern crate bytes;
#[macro_use]
extern crate bitflags;