mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-10-02 23:04:40 +00:00
Merge pull request #580 from zeenix/add-debug
Add missing `Debug` derive to `vec::IntoIter`
This commit is contained in:
commit
0c9508d72e
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Removed generic from `history_buf::OldestOrdered`.
|
- Removed generic from `history_buf::OldestOrdered`.
|
||||||
- Made `LenType` opt-in.
|
- Made `LenType` opt-in.
|
||||||
- Minor fixes to `pool::boxed` docs.
|
- Minor fixes to `pool::boxed` docs.
|
||||||
|
- Add missing `Debug` derive to `vec::IntoIter`.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -1495,6 +1495,31 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T, LenT: LenType, const N: usize> core::fmt::Debug for IntoIter<T, N, LenT>
|
||||||
|
where
|
||||||
|
T: core::fmt::Debug,
|
||||||
|
{
|
||||||
|
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||||
|
let s = if self.next < self.vec.len {
|
||||||
|
unsafe {
|
||||||
|
slice::from_raw_parts(
|
||||||
|
self.vec
|
||||||
|
.buffer
|
||||||
|
.buffer
|
||||||
|
.as_ptr()
|
||||||
|
.cast::<T>()
|
||||||
|
.add(self.next.into_usize()),
|
||||||
|
(self.vec.len - self.next).into_usize(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
&[]
|
||||||
|
};
|
||||||
|
|
||||||
|
write!(f, "{s:?}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T, LenT: LenType, const N: usize> Drop for IntoIter<T, N, LenT> {
|
impl<T, LenT: LenType, const N: usize> Drop for IntoIter<T, N, LenT> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user