11use alloc:: format;
2+ use alloc:: string:: String ;
23use alloc:: vec:: Vec ;
34use core:: ops:: Range ;
45
56use vm_fdt:: { FdtWriter , FdtWriterNode , FdtWriterResult } ;
67
7- pub struct Fdt < ' a > {
8+ pub struct Fdt {
89 writer : FdtWriter ,
910 root_node : FdtWriterNode ,
10- bootargs : Option < & ' a str > ,
11+ bootargs : Option < String > ,
1112}
1213
13- impl < ' a > Fdt < ' a > {
14+ impl Fdt {
1415 pub fn new ( platform : & str ) -> FdtWriterResult < Self > {
1516 let mut writer = FdtWriter :: new ( ) ?;
1617
@@ -30,7 +31,7 @@ impl<'a> Fdt<'a> {
3031
3132 pub fn finish ( mut self ) -> FdtWriterResult < Vec < u8 > > {
3233 let chosen_node = self . writer . begin_node ( "chosen" ) ?;
33- if let Some ( bootargs) = self . bootargs {
34+ if let Some ( bootargs) = & self . bootargs {
3435 self . writer . property_string ( "bootargs" , bootargs) ?;
3536 }
3637 self . writer . end_node ( chosen_node) ?;
@@ -41,7 +42,7 @@ impl<'a> Fdt<'a> {
4142 }
4243
4344 #[ cfg_attr( target_os = "uefi" , expect( unused) ) ]
44- pub fn bootargs ( mut self , bootargs : & ' a str ) -> FdtWriterResult < Self > {
45+ pub fn bootargs ( mut self , bootargs : String ) -> FdtWriterResult < Self > {
4546 assert ! ( self . bootargs. is_none( ) ) ;
4647 self . bootargs = Some ( bootargs) ;
4748
@@ -75,7 +76,7 @@ mod x86_64 {
7576 use multiboot:: information:: { MemoryMapIter , MemoryType } ;
7677 use vm_fdt:: FdtWriterResult ;
7778
78- impl super :: Fdt < ' _ > {
79+ impl super :: Fdt {
7980 pub fn memory_regions (
8081 mut self ,
8182 memory_regions : MemoryMapIter < ' _ , ' _ > ,
@@ -105,7 +106,7 @@ mod uefi {
105106 use uefi:: mem:: memory_map:: { MemoryMap , MemoryMapMut } ;
106107 use vm_fdt:: FdtWriterResult ;
107108
108- impl super :: Fdt < ' _ > {
109+ impl super :: Fdt {
109110 pub fn memory_map ( mut self , memory_map : & mut impl MemoryMapMut ) -> FdtWriterResult < Self > {
110111 memory_map. sort ( ) ;
111112 info ! ( "Memory map:\n {}" , memory_map. display( ) ) ;
0 commit comments