diff options
Diffstat (limited to 'crates/shirabe/src/installer/library_installer.rs')
| -rw-r--r-- | crates/shirabe/src/installer/library_installer.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/crates/shirabe/src/installer/library_installer.rs b/crates/shirabe/src/installer/library_installer.rs index c1fedef..b50dbff 100644 --- a/crates/shirabe/src/installer/library_installer.rs +++ b/crates/shirabe/src/installer/library_installer.rs @@ -9,7 +9,7 @@ use shirabe_php_shim::{ realpath, rmdir, rtrim, strpos, }; -use crate::composer::PartialComposerWeakHandle; +use crate::composer::{AnyComposerWeakHandle, Composer, PartialComposer}; use crate::downloader::DownloadManager; use crate::installer::BinaryInstaller; use crate::installer::BinaryPresenceInterface; @@ -24,7 +24,7 @@ use crate::util::Silencer; /// Package installation manager. #[derive(Debug)] pub struct LibraryInstaller { - pub(crate) composer: PartialComposerWeakHandle, + pub(crate) composer: AnyComposerWeakHandle, pub(crate) vendor_dir: String, pub(crate) download_manager: Option<std::rc::Rc<std::cell::RefCell<DownloadManager>>>, pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, @@ -37,7 +37,7 @@ impl LibraryInstaller { /// Initializes library installer. pub fn new( io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, - composer: PartialComposerWeakHandle, + composer: AnyComposerWeakHandle, r#type: Option<String>, filesystem: Option<std::rc::Rc<std::cell::RefCell<Filesystem>>>, binary_installer: Option<BinaryInstaller>, @@ -48,15 +48,13 @@ impl LibraryInstaller { let download_manager = composer_rc .as_full() - .map(|full| full.borrow().get_download_manager()); - - let composer_ref = composer_rc.borrow_partial(); + .map(|full| full.get_download_manager()); let filesystem = filesystem .unwrap_or_else(|| std::rc::Rc::new(std::cell::RefCell::new(Filesystem::new(None)))); let vendor_dir = rtrim( // TODO(phase-b): Config::get returns PhpMixed; coerce to String via get_str. - &composer_ref + &composer_rc .get_config() .borrow_mut() .get_str("vendor-dir") @@ -68,7 +66,7 @@ impl LibraryInstaller { // TODO(phase-b): pass io by reference/clone todo!("io reference"), rtrim( - &composer_ref + &composer_rc .get_config() .borrow_mut() .get_str("bin-dir") @@ -76,7 +74,7 @@ impl LibraryInstaller { Some("/"), ), // TODO(phase-b): Config::get returns PhpMixed; coerce to String via get_str. - composer_ref + composer_rc .get_config() .borrow_mut() .get_str("bin-compat") |
