diff --git a/.travis.yml b/.travis.yml index 6d756a5..af682da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,13 @@ cache: cargo rust: - - 1.38.0 + - 1.36.0 - stable matrix: include: - - { os: osx, rust: 1.38.0 } - - { os: linux, rust: 1.38.0 } + - { os: osx, rust: 1.36.0 } + - { os: linux, rust: 1.36.0 } - { os: linux, rust: stable } - { os: linux, rust: nightly } diff --git a/appveyor.yml b/appveyor.yml index e1305ad..290c95c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,13 +6,13 @@ matrix: environment: matrix: - - channel: 1.39.0 + - channel: 1.36.0 target: i686-pc-windows-msvc - - channel: 1.39.0 + - channel: 1.36.0 target: x86_64-pc-windows-msvc - - channel: 1.39.0 + - channel: 1.36.0 target: i686-pc-windows-gnu - - channel: 1.39.0 + - channel: 1.36.0 target: x86_64-pc-windows-gnu install: diff --git a/src/tinyvec.rs b/src/tinyvec.rs index 07653b7..a6c223f 100644 --- a/src/tinyvec.rs +++ b/src/tinyvec.rs @@ -31,12 +31,9 @@ macro_rules! tiny_vec { }; ($array_type:ty, $($elem:expr),*) => { { - const INVOKED_ELEMENT_COUNT: usize = 0 $( +1 )*; - if INVOKED_ELEMENT_COUNT <= $array_type::CAPACITY { - TinyVec::<$array_type>::Inline(array_vec!($array_type, $($elem),*)) - } else { - TinyVec::<$array_type>::Heap(vec!($($elem:expr),*)) - } + let mut tv: TinyVec<$array_type> = Default::default(); + $( tv.push($elem); )* + tv } }; }