Skip to content

Commit

Permalink
Replace AioCb::from_bytes with more generic from_boxed_slice
Browse files Browse the repository at this point in the history
Supporting the bytes crate was unnecessarily specific.  This change
replaces from_bytes and from_bytes_mut with from_boxed_slice and
from_boxed_mut_slice, which can work with anything that implements
Borrow<[u8]> and BorrowMut<[u8]>, respectively.
  • Loading branch information
asomers committed Mar 14, 2018
1 parent c50bfb5 commit d812ba4
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 174 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

### Added
- Added safe support for nearly any buffer type in the `sys::aio` module.
([#872](https://github.com/nix-rust/nix/pull/872))
- Added `sys::aio::LioCb` as a wrapper for `libc::lio_listio`.
([#872](https://github.com/nix-rust/nix/pull/872))
- Added `getsid` in `::nix::unistd`
Expand All @@ -31,6 +33,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
([#837](https://github.com/nix-rust/nix/pull/837))

### Removed
- Removed explicit support for the `bytes` crate from the `sys::aio` module.
See `sys::aio::AioCb::from_boxed_slice`s examples for alternatives.
([#872](https://github.com/nix-rust/nix/pull/872))
- Removed `sys::aio::lio_listio`. Use `sys::aio::LioCb::listio` instead.
([#872](https://github.com/nix-rust/nix/pull/872))

Expand Down
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ bitflags = "1.0"
cfg-if = "0.1.0"
void = "1.0.2"

[dependencies.bytes]
version = "0.4.5"
# Don't include the optional serde feature
default-features = false

[target.'cfg(target_os = "dragonfly")'.build-dependencies]
gcc = "0.3"

[dev-dependencies]
# The examples use on a new feature of Bytes which should be available in 0.5.0
# https://github.com/carllerche/bytes/pull/185
bytes = { git = "https://github.com/carllerche/bytes", rev = "ae1b454" }
lazy_static = "1"
rand = "0.4"
tempdir = "0.3"
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#![deny(missing_debug_implementations)]

// External crates
extern crate bytes;
#[macro_use]
extern crate bitflags;
#[macro_use]
Expand Down
Loading

0 comments on commit d812ba4

Please sign in to comment.