From f411daceacad66e0bd774fda7d3c5ef8533cc55c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 26 May 2026 20:04:02 +0900 Subject: refactor(io): share IOInterface via Rc> handle Co-Authored-By: Claude Opus 4.7 --- crates/shirabe/src/util/svn.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/util/svn.rs') diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs index aa81f0f..737e75d 100644 --- a/crates/shirabe/src/util/svn.rs +++ b/crates/shirabe/src/util/svn.rs @@ -13,6 +13,7 @@ use shirabe_php_shim::{ use crate::config::Config; use crate::io::IOInterface; +use crate::io::IOInterfaceImmutable; use crate::util::Platform; use crate::util::ProcessExecutor; @@ -29,7 +30,7 @@ pub struct Svn { /// @var bool pub(crate) has_auth: Option, /// @var IOInterface - pub(crate) io: Box, + pub(crate) io: std::rc::Rc>, /// @var string pub(crate) url: String, /// @var bool @@ -50,12 +51,14 @@ impl Svn { pub fn new( url: String, - io: Box, + io: std::rc::Rc>, config: std::rc::Rc>, process: Option>>, ) -> Self { let process = process.unwrap_or_else(|| { - std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(&*io))) + std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(Some( + io.clone(), + )))) }); Self { url, @@ -95,7 +98,7 @@ impl Svn { // Ensure we are allowed to use this URL by config self.config.borrow_mut().prohibit_url_by_config( url, - Some(&*self.io), + Some(&*self.io.borrow()), &indexmap::IndexMap::new(), )?; -- cgit v1.3.1