File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -61,21 +61,21 @@ mod tests {
6161 #[ test]
6262 #[ should_panic]
6363 fn buf_mut_advance_mut_out_of_bounds_view ( ) {
64- let vec: & mut VecView < u8 , u8 > = & mut Vec :: < u8 , 8 > :: new ( ) ;
64+ let vec: & mut VecView < u8 , u8 > = & mut Vec :: < u8 , 8 , u8 > :: new ( ) ;
6565 unsafe { vec. advance_mut ( 9 ) } ;
6666 }
6767
6868 #[ test]
6969 fn buf_mut_remaining_mut_view ( ) {
70- let vec: & mut VecView < u8 , u8 > = & mut Vec :: < u8 , 8 > :: new ( ) ;
70+ let vec: & mut VecView < u8 , u8 > = & mut Vec :: < u8 , 8 , u8 > :: new ( ) ;
7171 assert_eq ! ( vec. remaining_mut( ) , 8 ) ;
7272 vec. push ( 42 ) . unwrap ( ) ;
7373 assert_eq ! ( vec. remaining_mut( ) , 7 ) ;
7474 }
7575
7676 #[ test]
7777 fn buf_mut_chunk_mut_view ( ) {
78- let vec: & mut VecView < u8 , u8 > = & mut Vec :: < u8 , 8 > :: new ( ) ;
78+ let vec: & mut VecView < u8 , u8 > = & mut Vec :: < u8 , 8 , u8 > :: new ( ) ;
7979 assert_eq ! ( vec. chunk_mut( ) . len( ) , 8 ) ;
8080 unsafe { vec. advance_mut ( 1 ) } ;
8181 assert_eq ! ( vec. chunk_mut( ) . len( ) , 7 ) ;
Original file line number Diff line number Diff line change 33//! # Example usage
44//!
55//! ```
6+ //! use core::ptr::addr_of_mut;
67//! use heapless::{arc_pool, pool::arc::{Arc, ArcBlock}};
78//!
89//! arc_pool!(MyArcPool: u128);
4546//! to the `ArcPool`. This requires an intermediate `const` value as shown below:
4647//!
4748//! ```
49+ //! use core::ptr::addr_of_mut;
4850//! use heapless::{arc_pool, pool::arc::ArcBlock};
4951//!
5052//! arc_pool!(MyArcPool: u128);
5456//! let blocks: &'static mut [ArcBlock<u128>] = {
5557//! const BLOCK: ArcBlock<u128> = ArcBlock::new(); // <=
5658//! static mut BLOCKS: [ArcBlock<u128>; POOL_CAPACITY] = [BLOCK; POOL_CAPACITY];
57- //! unsafe { addr_of_mut!(BLOCK ).as_mut().unwrap()S }
59+ //! unsafe { addr_of_mut!(BLOCKS ).as_mut().unwrap() }
5860//! };
5961//!
6062//! for block in blocks {
Original file line number Diff line number Diff line change 6161//! to the `BoxPool`. This requires an intermediate `const` value as shown below:
6262//!
6363//! ```
64+ //! use core::ptr::addr_of_mut;
6465//! use heapless::{box_pool, pool::boxed::BoxBlock};
6566//!
6667//! box_pool!(MyBoxPool: u128);
Original file line number Diff line number Diff line change 33//! # Example usage
44//!
55//! ```
6+ //! use core::ptr::addr_of_mut;
67//! use heapless::{object_pool, pool::object::{Object, ObjectBlock}};
78//!
89//! object_pool!(MyObjectPool: [u8; 128]);
4647//! to the `ObjectPool`. This requires an intermediate `const` value as shown below:
4748//!
4849//! ```
50+ //! use core::ptr::addr_of_mut;
4951//! use heapless::{object_pool, pool::object::ObjectBlock};
5052//!
5153//! object_pool!(MyObjectPool: [u8; 128]);
5557//! let blocks: &'static mut [ObjectBlock<[u8; 128]>] = {
5658//! const BLOCK: ObjectBlock<[u8; 128]> = ObjectBlock::new([0; 128]); // <=
5759//! static mut BLOCKS: [ObjectBlock<[u8; 128]>; POOL_CAPACITY] = [BLOCK; POOL_CAPACITY];
58- //! unsafe { addr_of_mut!(BLOCK ).as_mut().unwrap()S }
60+ //! unsafe { addr_of_mut!(BLOCKS ).as_mut().unwrap() }
5961//! };
6062//!
6163//! for block in blocks {
You can’t perform that action at this time.
0 commit comments