@@ -78,7 +78,7 @@ pub(crate) trait Component {
7878 fn validate ( & self , current : & InstalledContent ) -> Result < ValidationResult > ;
7979
8080 /// Locating efi vendor dir
81- fn get_efi_vendor ( & self , sysroot : & str ) -> Result < Option < String > > ;
81+ fn get_efi_vendor ( & self , sysroot : & Path ) -> Result < Option < String > > ;
8282}
8383
8484/// Given a component name, create an implementation.
@@ -204,7 +204,6 @@ mod tests {
204204 let tdp = td. path ( ) ;
205205 let tdupdates = "usr/lib/bootupd/updates/EFI" ;
206206 let tdir = openat:: Dir :: open ( tdp) ?;
207- let td = tdp. to_str ( ) . unwrap ( ) ;
208207
209208 tdir. ensure_dir_all ( tdupdates, 0o755 ) ?;
210209 let efi = tdir. sub_dir ( tdupdates) ?;
@@ -227,13 +226,13 @@ mod tests {
227226 let target_components: Vec < _ > = all_components. values ( ) . collect ( ) ;
228227 for & component in target_components. iter ( ) {
229228 if component. name ( ) == "BIOS" {
230- assert_eq ! ( component. get_efi_vendor( & td ) ?, None ) ;
229+ assert_eq ! ( component. get_efi_vendor( tdp ) ?, None ) ;
231230 }
232231 if component. name ( ) == "EFI" {
233- let x = component. get_efi_vendor ( & td ) ;
232+ let x = component. get_efi_vendor ( tdp ) ;
234233 assert_eq ! ( x. is_err( ) , true ) ;
235234 efi. remove_all ( "centos" ) ?;
236- assert_eq ! ( component. get_efi_vendor( & td ) ?, Some ( "fedora" . to_string( ) ) ) ;
235+ assert_eq ! ( component. get_efi_vendor( tdp ) ?, Some ( "fedora" . to_string( ) ) ) ;
237236 {
238237 let td_vendor = "usr/lib/efi/shim/15.8-3/EFI/centos" ;
239238 tdir. ensure_dir_all ( td_vendor, 0o755 ) ?;
@@ -245,16 +244,15 @@ mod tests {
245244 ) ?;
246245
247246 // usr/lib/efi wins and get 'centos'
248- assert_eq ! ( component. get_efi_vendor( & td ) ?, Some ( "centos" . to_string( ) ) ) ;
247+ assert_eq ! ( component. get_efi_vendor( tdp ) ?, Some ( "centos" . to_string( ) ) ) ;
249248 // find directly from usr/lib/efi and get 'centos'
250- let td_usr = format ! ( "{td}/ usr/lib/efi") ;
249+ let td_usr = tdp . join ( " usr/lib/efi") ;
251250 assert_eq ! (
252251 component. get_efi_vendor( & td_usr) ?,
253252 Some ( "centos" . to_string( ) )
254253 ) ;
255254 // find directly from updates and get 'fedora'
256- let td_efi =
257- format ! ( "{td}/{}" , component_updatedirname( & * * component) . display( ) ) ;
255+ let td_efi = tdp. join ( component_updatedirname ( & * * component) ) ;
258256 assert_eq ! (
259257 component. get_efi_vendor( & td_efi) ?,
260258 Some ( "fedora" . to_string( ) )
0 commit comments