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 {
7171
7272impl core:: fmt:: Debug for Attributes {
7373 fn fmt ( & self , f : & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
74+ // Worst case is "DRHSVA"
75+ let mut output = heapless:: String :: < 7 > :: new ( ) ;
7476 if self . is_lfn ( ) {
75- write ! ( f , "LFN" ) ? ;
77+ output . push_str ( "LFN" ) . unwrap ( ) ;
7678 } else {
7779 if self . is_directory ( ) {
78- write ! ( f , "D" ) ? ;
80+ output . push_str ( "D" ) . unwrap ( ) ;
7981 } else {
80- write ! ( f , "F" ) ? ;
82+ output . push_str ( "F" ) . unwrap ( ) ;
8183 }
8284 if self . is_read_only ( ) {
83- write ! ( f , "R" ) ? ;
85+ output . push_str ( "R" ) . unwrap ( ) ;
8486 }
8587 if self . is_hidden ( ) {
86- write ! ( f , "H" ) ? ;
88+ output . push_str ( "H" ) . unwrap ( ) ;
8789 }
8890 if self . is_system ( ) {
89- write ! ( f , "S" ) ? ;
91+ output . push_str ( "S" ) . unwrap ( ) ;
9092 }
9193 if self . is_volume ( ) {
92- write ! ( f , "V" ) ? ;
94+ output . push_str ( "V" ) . unwrap ( ) ;
9395 }
9496 if self . is_archive ( ) {
95- write ! ( f , "A" ) ? ;
97+ output . push_str ( "A" ) . unwrap ( ) ;
9698 }
9799 }
98- Ok ( ( ) )
100+ f . pad ( & output )
99101 }
100102}
101103
You can’t perform that action at this time.
0 commit comments