From d3f66a20c509965a138c95bfadada28147da335c Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sun, 9 Aug 2020 10:30:17 -0600 Subject: [PATCH] Add doc attributes for docs.rs build (#105) * add with_capacity method. * Improve docs. * . * name the correct requirements. --- Cargo.toml | 1 + src/tinyvec.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 9125f23..fcc6171 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ experimental_write_impl = [] [package.metadata.docs.rs] all-features = true +rustdoc-args = ["--cfg","docs_rs"] [profile.test] opt-level = 3 diff --git a/src/tinyvec.rs b/src/tinyvec.rs index 49c3786..f57d69d 100644 --- a/src/tinyvec.rs +++ b/src/tinyvec.rs @@ -26,6 +26,7 @@ use alloc::vec::{self, Vec}; /// let many_ints: TinyVec<[i32; 4]> = tiny_vec!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); /// ``` #[macro_export] +#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] macro_rules! tiny_vec { ($array_type:ty => $($elem:expr),* $(,)?) => { { @@ -82,6 +83,7 @@ pub enum TinyVecConstructor { /// let some_ints = tiny_vec!([i32; 4] => 1, 2, 3); /// ``` #[derive(Clone)] +#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] pub enum TinyVec { #[allow(missing_docs)] Inline(ArrayVec),