mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-27 12:30:35 +00:00
Add missing Debug
derive to vec::IntoIter
This commit is contained in:
parent
779e608eb6
commit
a290cec514
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Removed generic from `history_buf::OldestOrdered`.
|
||||
- Made `LenType` opt-in.
|
||||
- Minor fixes to `pool::boxed` docs.
|
||||
- Add missing `Debug` derive to `vec::IntoIter`.
|
||||
|
||||
### 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> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
|
Loading…
x
Reference in New Issue
Block a user