mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-19 22:33:42 -04:00
Add doc attributes for docs.rs build (#105)
* add with_capacity method. * Improve docs. * . * name the correct requirements.
This commit is contained in:
@@ -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<A: Array> {
|
||||
/// let some_ints = tiny_vec!([i32; 4] => 1, 2, 3);
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))]
|
||||
pub enum TinyVec<A: Array> {
|
||||
#[allow(missing_docs)]
|
||||
Inline(ArrayVec<A>),
|
||||
|
||||
Reference in New Issue
Block a user