Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

58
vendor/heapless/src/sealed.rs vendored Normal file
View File

@@ -0,0 +1,58 @@
#[allow(dead_code)]
#[allow(path_statements)]
pub(crate) const fn smaller_than<const N: usize, const MAX: usize>() {
Assert::<N, MAX>::LESS;
}
#[allow(dead_code)]
#[allow(path_statements)]
pub(crate) const fn greater_than_eq_0<const N: usize>() {
Assert::<N, 0>::GREATER_EQ;
}
#[allow(dead_code)]
#[allow(path_statements)]
pub(crate) const fn greater_than_0<const N: usize>() {
Assert::<N, 0>::GREATER;
}
#[allow(dead_code)]
#[allow(path_statements)]
pub(crate) const fn greater_than_1<const N: usize>() {
Assert::<N, 1>::GREATER;
}
#[allow(dead_code)]
#[allow(path_statements)]
pub(crate) const fn power_of_two<const N: usize>() {
Assert::<N, 0>::GREATER;
Assert::<N, 0>::POWER_OF_TWO;
}
#[allow(dead_code)]
/// Const assert hack
pub struct Assert<const L: usize, const R: usize>;
#[allow(dead_code)]
impl<const L: usize, const R: usize> Assert<L, R> {
/// Const assert hack
pub const GREATER_EQ: usize = L - R;
/// Const assert hack
pub const LESS_EQ: usize = R - L;
/// Const assert hack
pub const NOT_EQ: isize = 0 / (R as isize - L as isize);
/// Const assert hack
pub const EQ: usize = (R - L) + (L - R);
/// Const assert hack
pub const GREATER: usize = L - R - 1;
/// Const assert hack
pub const LESS: usize = R - L - 1;
/// Const assert hack
pub const POWER_OF_TWO: usize = 0 - (L & (L - 1));
}