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/common/http_downloader_mock.rs | |
| 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/common/http_downloader_mock.rs')
| -rw-r--r-- | crates/shirabe/tests/common/http_downloader_mock.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/crates/shirabe/tests/common/http_downloader_mock.rs b/crates/shirabe/tests/common/http_downloader_mock.rs index 85d3ec81..59519ca4 100644 --- a/crates/shirabe/tests/common/http_downloader_mock.rs +++ b/crates/shirabe/tests/common/http_downloader_mock.rs @@ -9,8 +9,6 @@ use shirabe::util::http_downloader::{ HttpDownloader, HttpDownloaderMockExpectation, HttpDownloaderMockHandler, }; use shirabe_php_shim::PhpMixed; -use std::cell::RefCell; -use std::rc::Rc; // A single HTTP request expectation as written in the PHP tests: a `url` plus an // optional response (`status`/`body`/`headers`). `options` of `None` matches any @@ -41,7 +39,7 @@ pub fn expect_full( } } -pub struct HttpDownloaderMockGuard(Rc<RefCell<HttpDownloader>>); +pub struct HttpDownloaderMockGuard(std::rc::Rc<std::cell::RefCell<HttpDownloader>>); impl Drop for HttpDownloaderMockGuard { fn drop(&mut self) { @@ -60,10 +58,16 @@ pub fn get_http_downloader_mock( expectations: Vec<HttpDownloaderMockExpectation>, strict: bool, default_handler: HttpDownloaderMockHandler, -) -> (Rc<RefCell<HttpDownloader>>, HttpDownloaderMockGuard) { - let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); - let config = Rc::new(RefCell::new(Config::new(false, None))); - let downloader = Rc::new(RefCell::new(HttpDownloader::__new_mock(io, config))); +) -> ( + std::rc::Rc<std::cell::RefCell<HttpDownloader>>, + HttpDownloaderMockGuard, +) { + 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 downloader = std::rc::Rc::new(std::cell::RefCell::new(HttpDownloader::__new_mock( + io, config, + ))); downloader .borrow_mut() .__expects(expectations, strict, default_handler); |
