File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -71,31 +71,33 @@ impl Attributes {
71
71
72
72
impl core:: fmt:: Debug for Attributes {
73
73
fn fmt ( & self , f : & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
74
+ // Worst case is "DRHSVA"
75
+ let mut output = heapless:: String :: < 7 > :: new ( ) ;
74
76
if self . is_lfn ( ) {
75
- write ! ( f , "LFN" ) ? ;
77
+ output . push_str ( "LFN" ) . unwrap ( ) ;
76
78
} else {
77
79
if self . is_directory ( ) {
78
- write ! ( f , "D" ) ? ;
80
+ output . push_str ( "D" ) . unwrap ( ) ;
79
81
} else {
80
- write ! ( f , "F" ) ? ;
82
+ output . push_str ( "F" ) . unwrap ( ) ;
81
83
}
82
84
if self . is_read_only ( ) {
83
- write ! ( f , "R" ) ? ;
85
+ output . push_str ( "R" ) . unwrap ( ) ;
84
86
}
85
87
if self . is_hidden ( ) {
86
- write ! ( f , "H" ) ? ;
88
+ output . push_str ( "H" ) . unwrap ( ) ;
87
89
}
88
90
if self . is_system ( ) {
89
- write ! ( f , "S" ) ? ;
91
+ output . push_str ( "S" ) . unwrap ( ) ;
90
92
}
91
93
if self . is_volume ( ) {
92
- write ! ( f , "V" ) ? ;
94
+ output . push_str ( "V" ) . unwrap ( ) ;
93
95
}
94
96
if self . is_archive ( ) {
95
- write ! ( f , "A" ) ? ;
97
+ output . push_str ( "A" ) . unwrap ( ) ;
96
98
}
97
99
}
98
- Ok ( ( ) )
100
+ f . pad ( & output )
99
101
}
100
102
}
101
103
You can’t perform that action at this time.
0 commit comments