@@ -105,6 +105,7 @@ use serde::{
105
105
use std:: io;
106
106
107
107
/// Error type for APIs with fallible heap allocation
108
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
108
109
#[ derive( Debug ) ]
109
110
pub enum CollectionAllocErr {
110
111
/// Overflow `usize::MAX` or other error during size computation
@@ -562,6 +563,18 @@ where
562
563
}
563
564
}
564
565
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
+
565
578
#[ cfg( feature = "extract_if" ) ]
566
579
impl < T , F , const N : usize > Iterator for ExtractIf < ' _ , T , N , F >
567
580
where
@@ -638,6 +651,17 @@ where
638
651
}
639
652
}
640
653
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
+
641
665
impl < I : Iterator , const N : usize > Iterator for Splice < ' _ , I , N > {
642
666
type Item = I :: Item ;
643
667
@@ -2851,6 +2875,33 @@ impl<T: Debug, const N: usize> Debug for Drain<'_, T, N> {
2851
2875
}
2852
2876
}
2853
2877
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
+
2854
2905
#[ cfg( feature = "serde" ) ]
2855
2906
#[ cfg_attr( docsrs, doc( cfg( feature = "serde" ) ) ) ]
2856
2907
impl < T , const N : usize > Serialize for SmallVec < T , N >
0 commit comments