diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-11 16:33:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-11 16:33:05 +0900 |
| commit | 27d00055df8691a6bd99aaf38633a7338b16cc6a (patch) | |
| tree | 4af17ccff5f8c2d09156fa62c559e60e3e683dac /crates/shirabe/tests/repository | |
| parent | 1ec2220def43e37e5a65b96dde93c19b493258f4 (diff) | |
| download | php-shirabe-27d00055df8691a6bd99aaf38633a7338b16cc6a.tar.gz php-shirabe-27d00055df8691a6bd99aaf38633a7338b16cc6a.tar.zst php-shirabe-27d00055df8691a6bd99aaf38633a7338b16cc6a.zip | |
chore: use fully-qualified name for Rc/RefCell
Diffstat (limited to 'crates/shirabe/tests/repository')
16 files changed, 175 insertions, 158 deletions
diff --git a/crates/shirabe/tests/repository/artifact_repository_test.rs b/crates/shirabe/tests/repository/artifact_repository_test.rs index 558ee8b1..2bfe85de 100644 --- a/crates/shirabe/tests/repository/artifact_repository_test.rs +++ b/crates/shirabe/tests/repository/artifact_repository_test.rs @@ -4,8 +4,6 @@ use indexmap::IndexMap; use shirabe::io::{IOInterface, NullIO}; use shirabe::repository::ArtifactRepository; use shirabe_php_shim::{PhpMixed, extension_loaded}; -use std::cell::RefCell; -use std::rc::Rc; /// Returns true when the test should be skipped because the zip extension is /// unavailable, mirroring PHP's markTestSkipped in setUp. @@ -29,7 +27,8 @@ fn create_repo(url: &str) -> ArtifactRepository { coordinates.insert("type".to_string(), PhpMixed::String("artifact".to_string())); coordinates.insert("url".to_string(), PhpMixed::String(url.to_string())); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); ArtifactRepository::new(coordinates, io).unwrap() } diff --git a/crates/shirabe/tests/repository/composer_repository_test.rs b/crates/shirabe/tests/repository/composer_repository_test.rs index 8e5a7f12..613dbb8e 100644 --- a/crates/shirabe/tests/repository/composer_repository_test.rs +++ b/crates/shirabe/tests/repository/composer_repository_test.rs @@ -11,8 +11,6 @@ use shirabe::repository::composer_repository::{ComposerRepository, ProviderListi use shirabe::util::http_downloader::HttpDownloaderMockHandler; use shirabe_php_shim::PhpMixed; use shirabe_semver::constraint::{AnyConstraint, SimpleConstraint}; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; // Mirrors PHP's `['url' => .., 'body' => ..]` mock entry (status defaults to 200, @@ -53,8 +51,8 @@ fn create_config_read_only() -> (Config, TempDir) { (config, home) } -fn null_io() -> Rc<RefCell<dyn IOInterface>> { - Rc::new(RefCell::new(NullIO::new())) +fn null_io() -> std::rc::Rc<std::cell::RefCell<dyn IOInterface>> { + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())) } fn repo_config(url: &str) -> IndexMap<String, PhpMixed> { @@ -250,9 +248,9 @@ fn test_what_provides() { ) .unwrap(); - let rc = Rc::new(RefCell::new(repo)); - let rc_dyn: Rc<RefCell<dyn RepositoryInterface>> = rc.clone(); - rc.borrow().set_self_handle(Rc::downgrade(&rc_dyn)); + let rc = std::rc::Rc::new(std::cell::RefCell::new(repo)); + let rc_dyn: std::rc::Rc<std::cell::RefCell<dyn RepositoryInterface>> = rc.clone(); + rc.borrow().set_self_handle(std::rc::Rc::downgrade(&rc_dyn)); let mut provider_listing: IndexMap<String, ProviderListingEntry> = IndexMap::new(); provider_listing.insert("a".to_string(), ProviderListingEntry { sha256 }); diff --git a/crates/shirabe/tests/repository/filesystem_repository_test.rs b/crates/shirabe/tests/repository/filesystem_repository_test.rs index e8bdddb2..f9d03ecd 100644 --- a/crates/shirabe/tests/repository/filesystem_repository_test.rs +++ b/crates/shirabe/tests/repository/filesystem_repository_test.rs @@ -15,8 +15,6 @@ use shirabe::repository::filesystem_repository::FilesystemRepository; use shirabe::util::filesystem::Filesystem; use shirabe_php_shim::PhpMixed; use shirabe_semver::VersionParser; -use std::cell::RefCell; -use std::rc::Rc; /// PHP mocks JsonFile::read()/exists(); without a mocking framework the canned read value is /// materialized as a real temp file whose decoded JSON reproduces the mock return value exactly. @@ -107,14 +105,14 @@ mockall::mock! { fn execute( &mut self, repo: &mut dyn InstalledRepositoryInterface, - operations: Vec<Rc<dyn OperationInterface>>, + operations: Vec<std::rc::Rc<dyn OperationInterface>>, dev_mode: bool, run_scripts: bool, download_only: bool, ) -> anyhow::Result<()>; fn get_install_path(&mut self, package: PackageInterfaceHandle) -> Option<String>; fn set_output_progress(&mut self, output_progress: bool); - fn notify_installs(&mut self, io: Rc<RefCell<dyn IOInterface>>); + fn notify_installs(&mut self, io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>); } } diff --git a/crates/shirabe/tests/repository/path_repository_test.rs b/crates/shirabe/tests/repository/path_repository_test.rs index f86d659d..1cd034d2 100644 --- a/crates/shirabe/tests/repository/path_repository_test.rs +++ b/crates/shirabe/tests/repository/path_repository_test.rs @@ -11,8 +11,6 @@ use shirabe::util::{Platform, ProcessExecutor}; use shirabe_php_shim::{ DIRECTORY_SEPARATOR, PhpMixed, file_get_contents, hash, realpath, serialize, }; -use std::cell::RefCell; -use std::rc::Rc; fn fixtures_dir() -> String { format!( @@ -23,14 +21,15 @@ fn fixtures_dir() -> String { /// ref: PathRepositoryTest::createPathRepo fn create_path_repo(options: IndexMap<String, PhpMixed>) -> PathRepository { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); - let proc = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); + let proc = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); // ref: createPathRepo wires the ProcessExecutor through a Loop so the VersionGuesser's async // git calls are permitted; constructing the Loop calls enable_async() on the shared executor. - let http_downloader = Rc::new(RefCell::new(HttpDownloader::new( + let http_downloader = std::rc::Rc::new(std::cell::RefCell::new(HttpDownloader::new( io.clone(), config.clone(), IndexMap::new(), diff --git a/crates/shirabe/tests/repository/repository_factory_test.rs b/crates/shirabe/tests/repository/repository_factory_test.rs index ef523808..287e7a4e 100644 --- a/crates/shirabe/tests/repository/repository_factory_test.rs +++ b/crates/shirabe/tests/repository/repository_factory_test.rs @@ -7,14 +7,13 @@ use shirabe::io::null_io::NullIO; use shirabe::repository::RepositoryFactory; use shirabe::util::http_downloader::HttpDownloader; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; #[test] fn test_manager_with_all_repository_types() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(false, None))); - let http_downloader = Rc::new(RefCell::new(HttpDownloader::new( + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(false, None))); + let http_downloader = std::rc::Rc::new(std::cell::RefCell::new(HttpDownloader::new( io.clone(), config.clone(), IndexMap::new(), diff --git a/crates/shirabe/tests/repository/repository_manager_test.rs b/crates/shirabe/tests/repository/repository_manager_test.rs index c67cec49..2eac5265 100644 --- a/crates/shirabe/tests/repository/repository_manager_test.rs +++ b/crates/shirabe/tests/repository/repository_manager_test.rs @@ -14,8 +14,6 @@ use shirabe::repository::{ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::HttpDownloader; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -50,13 +48,15 @@ impl Drop for TearDown { } } -fn null_io() -> Rc<RefCell<dyn IOInterface>> { - Rc::new(RefCell::new(NullIO::new())) +fn null_io() -> std::rc::Rc<std::cell::RefCell<dyn IOInterface>> { + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())) } -fn http_downloader(io: &Rc<RefCell<dyn IOInterface>>) -> Rc<RefCell<HttpDownloader>> { - let config = Rc::new(RefCell::new(Config::new(false, None))); - Rc::new(RefCell::new(HttpDownloader::new( +fn http_downloader( + io: &std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, +) -> std::rc::Rc<std::cell::RefCell<HttpDownloader>> { + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(false, None))); + std::rc::Rc::new(std::cell::RefCell::new(HttpDownloader::new( io.clone(), config, IndexMap::new(), @@ -78,7 +78,7 @@ fn test_prepend() { let _tear_down = TearDown::new(tmpdir.path().to_path_buf()); let io = null_io(); - let config = Rc::new(RefCell::new(Config::new(false, None))); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(false, None))); let mut rm = RepositoryManager::new(io.clone(), config, http_downloader(&io), None, None); let repository1 = RepositoryInterfaceHandle::new(ArrayRepository::new(vec![]).unwrap()); @@ -96,7 +96,7 @@ fn test_repo_creation() { let _tear_down = TearDown::new(tmpdir.path().to_path_buf()); let io = null_io(); - let config = Rc::new(RefCell::new(Config::new(false, None))); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(false, None))); let mut rm = RepositoryManager::new(io.clone(), config.clone(), http_downloader(&io), None, None); @@ -181,7 +181,7 @@ fn test_invalid_repo_creation_throws() { let _tear_down = TearDown::new(tmpdir.path().to_path_buf()); let io = null_io(); - let config = Rc::new(RefCell::new(Config::new(false, None))); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(false, None))); let rm = RepositoryManager::new(io.clone(), config.clone(), http_downloader(&io), None, None); config.borrow_mut().merge( @@ -217,7 +217,7 @@ fn test_filter_repo_wrapping() { let _tear_down = TearDown::new(tmpdir.path().to_path_buf()); let io = null_io(); - let config = Rc::new(RefCell::new(Config::new(false, None))); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(false, None))); let mut rm = RepositoryManager::new(io.clone(), config, http_downloader(&io), None, None); rm.set_repository_class("path", "Composer\\Repository\\PathRepository"); diff --git a/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs b/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs index 296309f4..d9138b0c 100644 --- a/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs @@ -11,14 +11,12 @@ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler}; use shirabe::util::process_executor::MockHandler; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { home: TempDir, - config: Rc<RefCell<Config>>, - io: Rc<RefCell<dyn IOInterface>>, + config: std::rc::Rc<std::cell::RefCell<Config>>, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, } fn set_up() -> SetUp { @@ -39,11 +37,12 @@ fn set_up() -> SetUp { // PHP mocks IOInterface with isInteractive() => true; on the passing (200) paths // exercised here the interactivity flag is never consulted, so a bare NullIO matches. - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); SetUp { home, - config: Rc::new(RefCell::new(config)), + config: std::rc::Rc::new(std::cell::RefCell::new(config)), io, } } @@ -73,7 +72,7 @@ impl Drop for TearDown { fn initialize_driver( set_up: &SetUp, repo_url: &str, - http_downloader: Rc<RefCell<HttpDownloader>>, + http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>, ) -> (ForgejoDriver, ProcessExecutorMockGuard) { let (process, process_guard) = get_process_executor_mock(vec![], false, MockHandler::default()); @@ -93,7 +92,10 @@ fn initialize_driver( fn http_mock( expectations: Vec<shirabe::util::http_downloader::HttpDownloaderMockExpectation>, -) -> (Rc<RefCell<HttpDownloader>>, HttpDownloaderMockGuard) { +) -> ( + std::rc::Rc<std::cell::RefCell<HttpDownloader>>, + HttpDownloaderMockGuard, +) { get_http_downloader_mock(expectations, true, HttpDownloaderMockHandler::default()) } diff --git a/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs b/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs index 1a5a4256..77c1f130 100644 --- a/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/fossil_driver_test.rs @@ -7,8 +7,6 @@ use shirabe::io::null_io::NullIO; use shirabe::repository::vcs::FossilDriver; use shirabe::util::filesystem::Filesystem; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -66,8 +64,9 @@ fn support_provider() -> Vec<(&'static str, bool)> { #[test] fn test_support() { for (url, assertion) in support_provider() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); let result = FossilDriver::supports(io, config, url, false).unwrap(); assert_eq!(assertion, result); } diff --git a/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs b/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs index 124d5291..4d84bcf2 100644 --- a/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs @@ -11,8 +11,6 @@ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler}; use shirabe::util::process_executor::ProcessExecutor; use shirabe_php_shim::{InvalidArgumentException, PhpMixed, RuntimeException}; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -70,14 +68,16 @@ fn http_body( // then calls initialize(). fn get_driver( url: &str, - io: Rc<RefCell<dyn IOInterface>>, - config: Rc<RefCell<Config>>, - http_downloader: Rc<RefCell<HttpDownloader>>, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, + config: std::rc::Rc<std::cell::RefCell<Config>>, + http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>, ) -> anyhow::Result<GitBitbucketDriver> { let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(url.to_string())); - let process = Rc::new(RefCell::new(ProcessExecutor::new(Some(io.clone())))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(Some( + io.clone(), + )))); let mut driver = GitBitbucketDriver::new(repo_config, io, config, http_downloader, process); driver.initialize()?; @@ -89,8 +89,9 @@ fn test_get_root_identifier_wrong_scm_type() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock( vec![http_body( @@ -124,8 +125,9 @@ fn test_driver() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let urls = [ "https://api.bitbucket.org/2.0/repositories/user/repo?fields=-project%2C-owner", @@ -238,8 +240,9 @@ fn test_initialize_invalid_repository_url() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard) = get_http_downloader_mock(vec![], true, HttpDownloaderMockHandler::default()); @@ -257,8 +260,9 @@ fn test_invalid_support_data() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let repo_url = "https://bitbucket.org/user/repo.git"; @@ -306,8 +310,9 @@ fn test_invalid_support_data() { #[test] fn test_supports() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); assert!( GitBitbucketDriver::supports( diff --git a/crates/shirabe/tests/repository/vcs/git_driver_test.rs b/crates/shirabe/tests/repository/vcs/git_driver_test.rs index be26dd1d..7a85d4cc 100644 --- a/crates/shirabe/tests/repository/vcs/git_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/git_driver_test.rs @@ -13,8 +13,6 @@ use shirabe::util::http_downloader::HttpDownloaderMockHandler; use shirabe::util::platform::Platform; use shirabe::util::process_executor::MockHandler; use shirabe_php_shim::{PhpMixed, RuntimeException}; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -80,8 +78,9 @@ fn test_get_root_identifier_from_remote_local_repository() { let home_path = home.path().to_string_lossy().into_owned(); let _tear_down = TearDown::new(home.path().to_path_buf(), network_env); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -114,8 +113,9 @@ fn test_get_root_identifier_from_remote() { let home_path = home.path().to_string_lossy().into_owned(); let _tear_down = TearDown::new(home.path().to_path_buf(), network_env); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -182,8 +182,9 @@ fn test_get_root_identifier_from_local_with_network_disabled() { Platform::put_env("COMPOSER_DISABLE_NETWORK", "1"); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -218,8 +219,9 @@ fn test_get_branches_filter_invalid_branch_names() { let home_path = home.path().to_string_lossy().into_owned(); let _tear_down = TearDown::new(home.path().to_path_buf(), network_env); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -270,8 +272,9 @@ fn test_file_get_content_invalid_identifier() { } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf(), network_env); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -302,8 +305,9 @@ fn test_get_change_date_invalid_identifier() { } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf(), network_env); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); diff --git a/crates/shirabe/tests/repository/vcs/github_driver_test.rs b/crates/shirabe/tests/repository/vcs/github_driver_test.rs index 11da393a..5b8367c7 100644 --- a/crates/shirabe/tests/repository/vcs/github_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/github_driver_test.rs @@ -15,8 +15,6 @@ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::HttpDownloaderMockHandler; use shirabe::util::process_executor::{MockHandler, ProcessExecutor}; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -136,8 +134,9 @@ fn test_supports() { let _tear_down = TearDown::new(home.path().to_path_buf()); for (expected, repo_url) in supports_provider() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); assert_eq!( expected, @@ -157,13 +156,14 @@ fn test_private_repository() { let identifier = "v0.0.0"; let sha = "SOMESHA"; - let config = Rc::new(RefCell::new(config)); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new( - IOStub::new() - .with_is_interactive(true) - .with_ask_and_hide_answer(Some("sometoken".to_string())), - )); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new( + IOStub::new() + .with_is_interactive(true) + .with_ask_and_hide_answer(Some("sometoken".to_string())), + )); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock( vec![ @@ -239,9 +239,10 @@ fn test_public_repository() { let identifier = "v0.0.0"; let sha = "SOMESHA"; - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(true))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(true)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![http_body( @@ -252,7 +253,7 @@ fn test_public_repository() { HttpDownloaderMockHandler::default(), ); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(repo_url.to_string())); @@ -296,9 +297,10 @@ fn test_public_repository2() { let identifier = "feature/3.2-foo"; let sha = "SOMESHA"; - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(true))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(true)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![ @@ -329,7 +331,7 @@ fn test_public_repository2() { HttpDownloaderMockHandler::default(), ); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(repo_url.to_string())); @@ -379,9 +381,10 @@ fn test_invalid_support_data() { let identifier = "feature/3.2-foo"; let sha = "SOMESHA"; - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(true))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(true)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![ @@ -412,7 +415,7 @@ fn test_invalid_support_data() { HttpDownloaderMockHandler::default(), ); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(repo_url.to_string())); @@ -522,9 +525,10 @@ fn test_funding_format() { let identifier = "feature/3.2-foo"; let sha = "SOMESHA"; - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(true))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(true)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![ @@ -552,7 +556,7 @@ fn test_funding_format() { HttpDownloaderMockHandler::default(), ); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(repo_url.to_string())); @@ -621,9 +625,10 @@ fn test_public_repository_archived() { sha ); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(true))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(true)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![ @@ -657,7 +662,7 @@ fn test_public_repository_archived() { HttpDownloaderMockHandler::default(), ); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(repo_url.to_string())); @@ -688,9 +693,10 @@ fn test_private_repository_no_interaction() { let identifier = "v0.0.0"; let sha = "SOMESHA"; - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(false))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(false)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![http_status(repo_api_url, 404)], @@ -810,12 +816,13 @@ fn test_initialize_invalid_repo_url() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard) = get_http_downloader_mock(vec![], true, HttpDownloaderMockHandler::default()); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(url.to_string())); @@ -838,9 +845,10 @@ fn test_get_empty_file_content() { let repo_url = "http://github.com/composer/packagist"; - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = - Rc::new(RefCell::new(IOStub::new().with_is_interactive(true))); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = std::rc::Rc::new( + std::cell::RefCell::new(IOStub::new().with_is_interactive(true)), + ); let (http_downloader, _http_guard) = get_http_downloader_mock( vec![ @@ -857,7 +865,7 @@ fn test_get_empty_file_content() { HttpDownloaderMockHandler::default(), ); - let process = Rc::new(RefCell::new(ProcessExecutor::new(None))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(None))); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(repo_url.to_string())); diff --git a/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs b/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs index f3648630..1a201ba0 100644 --- a/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs @@ -10,8 +10,6 @@ use shirabe::repository::vcs::GitLabDriver; use shirabe::util::http_downloader::{HttpDownloader, HttpDownloaderMockHandler}; use shirabe::util::process_executor::{MockHandler, ProcessExecutor}; use shirabe_php_shim::{PhpMixed, extension_loaded}; -use std::cell::RefCell; -use std::rc::Rc; // Mirrors GitLabDriverTest::setUp's `gitlab-domains` configuration. fn make_config() -> Config { @@ -38,15 +36,16 @@ fn make_config() -> Config { // bare `getMock()` ProcessExecutor; none of these tests invoke git, so an empty // strict expectation set both matches PHP and catches unexpected process calls. struct Fixtures { - io: Rc<RefCell<dyn IOInterface>>, - config: Rc<RefCell<Config>>, - process: Rc<RefCell<ProcessExecutor>>, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, + config: std::rc::Rc<std::cell::RefCell<Config>>, + process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>, _process_guard: ProcessExecutorMockGuard, } fn fixtures() -> Fixtures { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(make_config())); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(make_config())); let (process, _process_guard) = get_process_executor_mock(vec![], true, MockHandler::default()); Fixtures { io, @@ -60,7 +59,10 @@ fn fixtures() -> Fixtures { fn http_mock_with_body( url: &str, body: &str, -) -> (Rc<RefCell<HttpDownloader>>, HttpDownloaderMockGuard) { +) -> ( + std::rc::Rc<std::cell::RefCell<HttpDownloader>>, + HttpDownloaderMockGuard, +) { get_http_downloader_mock( vec![expect_full(url, None, 200, body, vec![String::new()])], true, @@ -625,8 +627,9 @@ fn test_get_branches() { #[test] fn test_supports() { for (url, expected) in data_for_test_supports() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(make_config())); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(make_config())); assert_eq!( expected, @@ -867,7 +870,7 @@ fn test_protocol_override_repository_url_generation() { ); top.insert("config".to_string(), PhpMixed::Array(config_section)); config.merge(&top, Config::SOURCE_UNKNOWN); - let config = Rc::new(RefCell::new(config)); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new(); repo_config.insert("url".to_string(), PhpMixed::String(url.to_string())); diff --git a/crates/shirabe/tests/repository/vcs/hg_driver_test.rs b/crates/shirabe/tests/repository/vcs/hg_driver_test.rs index 5e16c679..be36f412 100644 --- a/crates/shirabe/tests/repository/vcs/hg_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/hg_driver_test.rs @@ -12,8 +12,6 @@ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::HttpDownloaderMockHandler; use shirabe::util::process_executor::MockHandler; use shirabe_php_shim::{PhpMixed, RuntimeException}; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -70,8 +68,9 @@ fn supports_data_provider() -> Vec<&'static str> { #[test] fn test_supports() { for repository_url in supports_data_provider() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); assert!(HgDriver::supports(io, config, repository_url, false).unwrap()); } @@ -82,8 +81,9 @@ fn test_get_branches_filter_invalid_branch_names() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -120,8 +120,9 @@ fn test_file_get_content_invalid_identifier() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); @@ -148,8 +149,9 @@ fn test_get_change_date_invalid_identifier() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); diff --git a/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs b/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs index 13b36a3c..ea7976fd 100644 --- a/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/perforce_driver_test.rs @@ -10,8 +10,6 @@ use shirabe::util::HttpDownloader; use shirabe::util::filesystem::Filesystem; use shirabe::util::process_executor::MockHandler; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; const TEST_URL: &str = "TEST_PERFORCE_URL"; @@ -92,9 +90,10 @@ fn make_driver( config: Config, repo_config: &IndexMap<String, PhpMixed>, ) -> (PerforceDriver, ProcessExecutorMockGuard) { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(config)); - let http_downloader = Rc::new(RefCell::new(HttpDownloader::new( + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let http_downloader = std::rc::Rc::new(std::cell::RefCell::new(HttpDownloader::new( io.clone(), config.clone(), IndexMap::new(), @@ -130,8 +129,9 @@ impl Drop for TearDown { #[test] fn test_supports_returns_false_no_deep_check() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); assert!(!PerforceDriver::supports(io, config, "existing.url", false).unwrap()); } diff --git a/crates/shirabe/tests/repository/vcs/svn_driver_test.rs b/crates/shirabe/tests/repository/vcs/svn_driver_test.rs index 70eeeadc..6a74063d 100644 --- a/crates/shirabe/tests/repository/vcs/svn_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/svn_driver_test.rs @@ -12,8 +12,6 @@ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::HttpDownloaderMockHandler; use shirabe::util::process_executor::MockHandler; use shirabe_php_shim::{PhpMixed, RuntimeException}; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -69,8 +67,9 @@ fn support_provider() -> Vec<(&'static str, bool)> { #[test] fn test_support() { for (url, assertion) in support_provider() { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(true, None))); + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(Config::new(true, None))); assert_eq!( assertion, @@ -84,8 +83,9 @@ fn test_wrong_credentials_in_url() { let SetUp { home, config } = set_up(); let _tear_down = TearDown::new(home.path().to_path_buf()); - let config = Rc::new(RefCell::new(config)); - let console: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(IOStub::new())); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); + let console: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(IOStub::new())); let (http_downloader, _http_guard): (_, HttpDownloaderMockGuard) = get_http_downloader_mock(vec![], false, HttpDownloaderMockHandler::default()); diff --git a/crates/shirabe/tests/repository/vcs_repository_test.rs b/crates/shirabe/tests/repository/vcs_repository_test.rs index 1ee72cb8..9ae3eac4 100644 --- a/crates/shirabe/tests/repository/vcs_repository_test.rs +++ b/crates/shirabe/tests/repository/vcs_repository_test.rs @@ -11,8 +11,6 @@ use shirabe::util::filesystem::Filesystem; use shirabe::util::http_downloader::HttpDownloader; use shirabe::util::r#loop::Loop; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; use tempfile::TempDir; struct SetUp { @@ -196,16 +194,19 @@ fn test_load_versions() { ); top.insert("config".to_string(), PhpMixed::Array(config_section)); config.merge(&top, Config::SOURCE_UNKNOWN); - let config = Rc::new(RefCell::new(config)); + let config = std::rc::Rc::new(std::cell::RefCell::new(config)); - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let http_downloader = Rc::new(RefCell::new(HttpDownloader::new( + let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = + std::rc::Rc::new(std::cell::RefCell::new(NullIO::new())); + let http_downloader = std::rc::Rc::new(std::cell::RefCell::new(HttpDownloader::new( io.clone(), config.clone(), IndexMap::new(), false, ))); - let process = Rc::new(RefCell::new(ProcessExecutor::new(Some(io.clone())))); + let process = std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(Some( + io.clone(), + )))); // VcsRepository's git driver / VersionGuesser run async git processes; constructing a Loop // enables async on the shared ProcessExecutor. let _loop = Loop::new(http_downloader.clone(), Some(process.clone())); |
