mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-10-02 14:54:30 +00:00
make my code look more like jeremysalwen
This commit is contained in:
parent
ff4cdab2ab
commit
ef94d68a04
@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Added support for AVR architecture
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
## [v0.7.10] - 2022-01-21
|
## [v0.7.10] - 2022-01-21
|
||||||
|
@ -95,7 +95,7 @@ where
|
|||||||
|
|
||||||
// Internal macro for generating indexes for the linkedlist and const new for the linked list
|
// Internal macro for generating indexes for the linkedlist and const new for the linked list
|
||||||
macro_rules! impl_index_and_const_new {
|
macro_rules! impl_index_and_const_new {
|
||||||
($name:ident, $ty:ty, $new_name:ident, $max_val:literal) => {
|
($name:ident, $ty:ty, $new_name:ident, $max_val:expr) => {
|
||||||
/// Index for the [`SortedLinkedList`] with specific backing storage.
|
/// Index for the [`SortedLinkedList`] with specific backing storage.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct $name($ty);
|
pub struct $name($ty);
|
||||||
@ -178,12 +178,11 @@ macro_rules! impl_index_and_const_new {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_index_and_const_new!(LinkedIndexU8, u8, new_u8, 254); // val is 2^8 - 2 (one less than max)
|
impl_index_and_const_new!(LinkedIndexU8, u8, new_u8, { u8::MAX as usize - 1 });
|
||||||
impl_index_and_const_new!(LinkedIndexU16, u16, new_u16, 65_534); // val is 2^16 - 2
|
impl_index_and_const_new!(LinkedIndexU16, u16, new_u16, { u16::MAX as usize - 1 });
|
||||||
#[cfg(target_pointer_width = "16")]
|
impl_index_and_const_new!(LinkedIndexUsize, usize, new_usize, {
|
||||||
impl_index_and_const_new!(LinkedIndexUsize, usize, new_usize, 65_534); // val is 2^16 - 2
|
usize::MAX as usize - 1
|
||||||
#[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))]
|
});
|
||||||
impl_index_and_const_new!(LinkedIndexUsize, usize, new_usize, 4_294_967_294); // val is 2^32 - 2
|
|
||||||
|
|
||||||
impl<T, Idx, K, const N: usize> SortedLinkedList<T, Idx, K, N>
|
impl<T, Idx, K, const N: usize> SortedLinkedList<T, Idx, K, N>
|
||||||
where
|
where
|
||||||
|
Loading…
x
Reference in New Issue
Block a user