mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-19 14:23:33 -04:00
sigh
This commit is contained in:
+3
-3
@@ -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 }
|
||||
|
||||
|
||||
+4
-4
@@ -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:
|
||||
|
||||
+3
-6
@@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user