Skip to content

Commit

Permalink
Merge pull request #277 from iqlusioninc/zeroize/rename-bytes-preview…
Browse files Browse the repository at this point in the history
…-cargo-feature

zeroize: Rename `bytes` feature to `bytes-preview`
  • Loading branch information
tony-iqlusion authored Oct 13, 2019
2 parents 9a82d85 + 1c97a68 commit 518310c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions zeroize/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ bytes = { version = "0.4", optional = true }
[features]
default = ["alloc"]
alloc = []
bytes-preview = ["bytes"]
1 change: 0 additions & 1 deletion zeroize/src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use super::Zeroize;
use ::bytes::BytesMut;

#[cfg(feature = "bytes")]
impl Zeroize for BytesMut {
fn zeroize(&mut self) {
self.resize(self.capacity(), Default::default());
Expand Down
15 changes: 14 additions & 1 deletion zeroize/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@
//! }
//! ```
//!
//! ## `bytes-preview` feature: `Zeroize` support for `BytesMut`
//!
//! This crate contains an impl of `Zeroize` for the `BytesMut` type from the
//! `bytes` crate.
//!
//! As `bytes` is not yet 1.0, this is a "preview" feature which we do not
//! include in SemVer guarantees around the `zeroize` crate. Ideally, we can
//! upstream the implementation and remove the feature entirely.
//!
//! Whenever we make any changes to how the `bytes-preview` feature works,
//! such as upgrading the `bytes` crate version or removing it after
//! successfully upstreaming, it will be done with a minor version bump.
//!
//! ## What guarantees does this crate provide?
//!
//! This crate guarantees the following:
Expand Down Expand Up @@ -200,7 +213,7 @@
#[cfg_attr(test, macro_use)]
extern crate alloc;

#[cfg(feature = "bytes")]
#[cfg(feature = "bytes-preview")]
mod bytes;

#[cfg(feature = "zeroize_derive")]
Expand Down

0 comments on commit 518310c

Please sign in to comment.