PacketQueue::new() uses ::init() when in nightly
This commit is contained in:
		
							parent
							
								
									90f2939bf6
								
							
						
					
					
						commit
						c1e93c0904
					
				@ -30,6 +30,16 @@ pub struct PacketQueue<const TX: usize, const RX: usize> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
impl<const TX: usize, const RX: usize> PacketQueue<TX, RX> {
 | 
					impl<const TX: usize, const RX: usize> PacketQueue<TX, RX> {
 | 
				
			||||||
    pub const fn new() -> Self {
 | 
					    pub const fn new() -> Self {
 | 
				
			||||||
 | 
					        #[cfg(feature = "nightly")]
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            let mut this = core::mem::MaybeUninit::uninit();
 | 
				
			||||||
 | 
					            unsafe {
 | 
				
			||||||
 | 
					                Self::init(&mut this);
 | 
				
			||||||
 | 
					                this.assume_init()
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        #[cfg(not(feature = "nightly"))]
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
            const NEW_TDES: TDes = TDes::new();
 | 
					            const NEW_TDES: TDes = TDes::new();
 | 
				
			||||||
            const NEW_RDES: RDes = RDes::new();
 | 
					            const NEW_RDES: RDes = RDes::new();
 | 
				
			||||||
            Self {
 | 
					            Self {
 | 
				
			||||||
@ -39,6 +49,7 @@ impl<const TX: usize, const RX: usize> PacketQueue<TX, RX> {
 | 
				
			|||||||
                rx_buf: [Packet([0; RX_BUFFER_SIZE]); RX],
 | 
					                rx_buf: [Packet([0; RX_BUFFER_SIZE]); RX],
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Allow to initialize a Self without requiring it to go on the stack
 | 
					    // Allow to initialize a Self without requiring it to go on the stack
 | 
				
			||||||
    #[cfg(feature = "nightly")]
 | 
					    #[cfg(feature = "nightly")]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user