From c48902fb78fe4556f6783c57cbf6a69000f3270c Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Sun, 5 Apr 2020 17:30:38 -0700 Subject: [PATCH 1/3] Make ToSmallVec trait public --- lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib.rs b/lib.rs index c935894..1fc0088 100644 --- a/lib.rs +++ b/lib.rs @@ -1697,7 +1697,9 @@ impl_array!( 0x40000, 0x60000, 0x80000, 0x10_0000 ); -trait ToSmallVec { +/// Convenience trait for constructing a `SmallVec` +pub trait ToSmallVec { + /// Construct a new `SmallVec` from a slice. fn to_smallvec(&self) -> SmallVec; } From 6a14df03e53d865098a3b986622920ca6348d08d Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Sun, 5 Apr 2020 17:50:59 -0700 Subject: [PATCH 2/3] Document Cargo features --- lib.rs | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib.rs b/lib.rs index 1fc0088..d6fd637 100644 --- a/lib.rs +++ b/lib.rs @@ -14,7 +14,16 @@ //! `write` feature implements the `std::io::Write` trait for vectors of `u8`. //! When this feature is enabled, `smallvec` depends on `std`. //! -//! ## `union` feature +//! ## Optional features +//! +//! ### `write` +//! +//! When this feature is enabled, `SmallVec<[u8; _]>` implements the `std::io::Write` trait. +//! This feature is not compatible with `#![no_std]` programs. +//! +//! ### `union` +//! +//! **This feature is unstable and requires a nightly build of the Rust toolchain.** //! //! When the `union` feature is enabled `smallvec` will track its state (inline or spilled) //! without the use of an enum tag, reducing the size of the `smallvec` by one machine word. @@ -24,6 +33,29 @@ //! //! To use this feature add `features = ["union"]` in the `smallvec` section of Cargo.toml. //! Note that this feature requires a nightly compiler (for now). +//! +//! ### `const_generics` +//! +//! **This feature is unstable and requires a nightly build of the Rust toolchain.** +//! +//! When this feature is enabled, `SmallVec` works with any arrays of any size, not just a fixed +//! list of sizes. +//! +//! ### `specialization` +//! +//! **This feature is unstable and requires a nightly build of the Rust toolchain.** +//! +//! When this feature is enabled, `SmallVec::from(slice)` has improved performance for slices +//! of `Copy` types. (Without this feature, you can use `SmallVec::from_slice` to get optimal +//! performance for `Copy` types.) +//! +//! ### `may_dangle` +//! +//! **This feature is unstable and requires a nightly build of the Rust toolchain.** +//! +//! This feature makes the Rust compiler less strict about use of vectors that contain borrowed +//! references. For details, see the +//! [Rustonomicon](https://doc.rust-lang.org/1.42.0/nomicon/dropck.html#an-escape-hatch). #![no_std] #![cfg_attr(feature = "union", feature(untagged_unions))] From 851d2226293cdf92eac20f82ce785b83b2f115d0 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Sun, 5 Apr 2020 19:13:20 -0700 Subject: [PATCH 3/3] Version 1.3.0 * Add a new unstable `const_generics` feature (#204). * Improve inlining of constructor functions (#206). * Add a `slice.to_smallvec()` convenience method (#203). * Documentation and testing improvements. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b5884fa..7fe519a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "smallvec" -version = "1.2.0" +version = "1.3.0" edition = "2018" authors = ["Simon Sapin "] license = "MIT/Apache-2.0"