55mod tests;
66
77use std:: path:: Path ;
8+ #[ cfg( test) ]
9+ use std:: sync:: Arc ;
810
911use anyhow:: { Context , Result , anyhow, bail} ;
1012use futures_util:: stream:: { FuturesUnordered , StreamExt } ;
@@ -171,7 +173,7 @@ impl Manifestation {
171173 // Begin transaction
172174 let mut tx = Transaction :: new (
173175 prefix. clone ( ) ,
174- & download_cfg. tmp_cx ,
176+ download_cfg. tmp_cx . clone ( ) ,
175177 download_cfg. permit_copy_rename ,
176178 ) ;
177179
@@ -265,7 +267,7 @@ impl Manifestation {
265267 pub ( crate ) fn uninstall (
266268 & self ,
267269 manifest : & Manifest ,
268- tmp_cx : & temp:: Context ,
270+ tmp_cx : Arc < temp:: Context > ,
269271 permit_copy_rename : bool ,
270272 ) -> Result < ( ) > {
271273 let prefix = self . installation . prefix ( ) ;
@@ -290,12 +292,12 @@ impl Manifestation {
290292 Ok ( ( ) )
291293 }
292294
293- fn uninstall_component < ' a > (
295+ fn uninstall_component (
294296 & self ,
295297 component : Component ,
296298 manifest : & Manifest ,
297- mut tx : Transaction < ' a > ,
298- ) -> Result < Transaction < ' a > > {
299+ mut tx : Transaction ,
300+ ) -> Result < Transaction > {
299301 // For historical reasons, the rust-installer component
300302 // names are not the same as the dist manifest component
301303 // names. Some are just the component name some are the
@@ -393,7 +395,7 @@ impl Manifestation {
393395 info ! ( "installing component rust" ) ;
394396
395397 // Begin transaction
396- let mut tx = Transaction :: new ( prefix, & dl_cfg. tmp_cx , dl_cfg. permit_copy_rename ) ;
398+ let mut tx = Transaction :: new ( prefix, dl_cfg. tmp_cx . clone ( ) , dl_cfg. permit_copy_rename ) ;
397399
398400 // Uninstall components
399401 let components = self . installation . list ( ) ?;
@@ -424,11 +426,11 @@ impl Manifestation {
424426 // doesn't have a configuration or manifest-derived list of
425427 // component/target pairs. Uninstall it using the installer's
426428 // component list before upgrading.
427- fn maybe_handle_v2_upgrade < ' a > (
429+ fn maybe_handle_v2_upgrade (
428430 & self ,
429431 config : & Option < Config > ,
430- mut tx : Transaction < ' a > ,
431- ) -> Result < Transaction < ' a > > {
432+ mut tx : Transaction ,
433+ ) -> Result < Transaction > {
432434 let installed_components = self . installation . list ( ) ?;
433435 let looks_like_v1 = config. is_none ( ) && !installed_components. is_empty ( ) ;
434436
@@ -674,12 +676,12 @@ impl<'a> ComponentBinary<'a> {
674676 Ok ( ( self , downloaded_file) )
675677 }
676678
677- fn install < ' t > (
679+ fn install (
678680 self ,
679681 installer_file : File ,
680- tx : Transaction < ' t > ,
682+ tx : Transaction ,
681683 manifestation : & Manifestation ,
682- ) -> Result < Transaction < ' t > > {
684+ ) -> Result < Transaction > {
683685 // For historical reasons, the rust-installer component
684686 // names are not the same as the dist manifest component
685687 // names. Some are just the component name some are the
0 commit comments