@@ -9,7 +9,7 @@ pub use fdt_raw::MemoryReservation;
99use fdt_raw:: { FdtError , Phandle , Status } ;
1010
1111use crate :: {
12- Node , NodeIter , NodeIterMut , NodeMut , NodeRef , NodeKind , ClockType ,
12+ ClockType , Node , NodeIter , NodeIterMut , NodeKind , NodeMut , NodeRef ,
1313 encode:: { FdtData , FdtEncoder } ,
1414} ;
1515
@@ -492,7 +492,11 @@ impl core::fmt::Display for Fdt {
492492
493493 // 输出内存保留块
494494 for reservation in & self . memory_reservations {
495- writeln ! ( f, "/memreserve/ 0x{:x} 0x{:x};" , reservation. address, reservation. size) ?;
495+ writeln ! (
496+ f,
497+ "/memreserve/ 0x{:x} 0x{:x};" ,
498+ reservation. address, reservation. size
499+ ) ?;
496500 }
497501
498502 // 输出根节点
@@ -522,7 +526,11 @@ impl Fdt {
522526 fn fmt_debug_deep ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
523527 writeln ! ( f, "Fdt {{" ) ?;
524528 writeln ! ( f, " boot_cpuid_phys: 0x{:x}," , self . boot_cpuid_phys) ?;
525- writeln ! ( f, " memory_reservations_count: {}," , self . memory_reservations. len( ) ) ?;
529+ writeln ! (
530+ f,
531+ " memory_reservations_count: {}," ,
532+ self . memory_reservations. len( )
533+ ) ?;
526534 writeln ! ( f, " phandle_cache_size: {}," , self . phandle_cache. len( ) ) ?;
527535 writeln ! ( f, " nodes:" ) ?;
528536
@@ -534,7 +542,13 @@ impl Fdt {
534542 writeln ! ( f, "}}" )
535543 }
536544
537- fn fmt_node_debug ( & self , f : & mut core:: fmt:: Formatter < ' _ > , node : & NodeRef , indent : usize , index : usize ) -> core:: fmt:: Result {
545+ fn fmt_node_debug (
546+ & self ,
547+ f : & mut core:: fmt:: Formatter < ' _ > ,
548+ node : & NodeRef ,
549+ indent : usize ,
550+ index : usize ,
551+ ) -> core:: fmt:: Result {
538552 // 打印缩进
539553 for _ in 0 ..indent {
540554 write ! ( f, " " ) ?;
@@ -580,8 +594,7 @@ impl Fdt {
580594 if !regions. is_empty ( ) {
581595 write ! ( f, " ({} regions" , regions. len( ) ) ?;
582596 for ( i, region) in regions. iter ( ) . take ( 2 ) . enumerate ( ) {
583- write ! ( f, ", [{}]: 0x{:x}+0x{:x}" ,
584- i, region. address, region. size) ?;
597+ write ! ( f, ", [{}]: 0x{:x}+0x{:x}" , i, region. address, region. size) ?;
585598 }
586599 if regions. len ( ) > 2 {
587600 write ! ( f, ", ..." ) ?;
0 commit comments