@@ -105,6 +105,7 @@ use serde::{
105105use std:: io;
106106
107107/// Error type for APIs with fallible heap allocation
108+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
108109#[ derive( Debug ) ]
109110pub enum CollectionAllocErr {
110111 /// Overflow `usize::MAX` or other error during size computation
@@ -562,6 +563,18 @@ where
562563 }
563564}
564565
566+ #[ cfg( all( feature = "extract_if" , feature = "defmt" ) ) ]
567+ #[ cfg_attr( docsrs, doc( cfg( feature = "defmt" ) ) ) ]
568+ impl < T , const N : usize , F > defmt:: Format for ExtractIf < ' _ , T , N , F >
569+ where
570+ F : FnMut ( & mut T ) -> bool ,
571+ T : defmt:: Format ,
572+ {
573+ fn format ( & self , fmt : defmt:: Formatter ) {
574+ defmt:: write!( fmt, "ExtractIf({:?})" , self . vec. as_slice( ) ) ;
575+ }
576+ }
577+
565578#[ cfg( feature = "extract_if" ) ]
566579impl < T , F , const N : usize > Iterator for ExtractIf < ' _ , T , N , F >
567580where
@@ -638,6 +651,17 @@ where
638651 }
639652}
640653
654+ #[ cfg( feature = "defmt" ) ]
655+ impl < ' a , I , const N : usize > defmt:: Format for Splice < ' a , I , N >
656+ where
657+ I : Iterator + ' a ,
658+ <I as Iterator >:: Item : defmt:: Format ,
659+ {
660+ fn format ( & self , fmt : defmt:: Formatter ) {
661+ defmt:: write!( fmt, "Splice({:?})" , self . drain) ;
662+ }
663+ }
664+
641665impl < I : Iterator , const N : usize > Iterator for Splice < ' _ , I , N > {
642666 type Item = I :: Item ;
643667
@@ -2851,6 +2875,33 @@ impl<T: Debug, const N: usize> Debug for Drain<'_, T, N> {
28512875 }
28522876}
28532877
2878+ #[ cfg( feature = "defmt" ) ]
2879+ #[ cfg_attr( docsrs, doc( cfg( feature = "defmt" ) ) ) ]
2880+ impl < T : defmt:: Format , const N : usize > defmt:: Format for SmallVec < T , N > {
2881+ fn format ( & self , fmt : defmt:: Formatter ) {
2882+ defmt:: write!( fmt, "{=[?]}" , self . as_slice( ) ) ;
2883+ }
2884+ }
2885+
2886+ #[ cfg( feature = "defmt" ) ]
2887+ #[ cfg_attr( docsrs, doc( cfg( feature = "defmt" ) ) ) ]
2888+ impl < T : defmt:: Format , const N : usize > defmt:: Format for IntoIter < T , N > {
2889+ fn format ( & self , fmt : defmt:: Formatter ) {
2890+ defmt:: write!( fmt, "IntoIter({=[?]})" , self . as_slice( ) ) ;
2891+ }
2892+ }
2893+
2894+ #[ cfg( feature = "defmt" ) ]
2895+ #[ cfg_attr( docsrs, doc( cfg( feature = "defmt" ) ) ) ]
2896+ impl < T : defmt:: Format , const N : usize > defmt:: Format for Drain
2897+ where
2898+ T : defmt:: Format ,
2899+ {
2900+ fn format ( & self , fmt : defmt:: Formatter ) {
2901+ defmt:: write!( fmt, "Drain({=[?]})" , self . iter. as_slice( ) ) ;
2902+ }
2903+ }
2904+
28542905#[ cfg( feature = "serde" ) ]
28552906#[ cfg_attr( docsrs, doc( cfg( feature = "serde" ) ) ) ]
28562907impl < T , const N : usize > Serialize for SmallVec < T , N >
0 commit comments