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/hg.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/util/hg.rs') diff --git a/crates/shirabe/src/util/hg.rs b/crates/shirabe/src/util/hg.rs index b6bdd04..47e80e2 100644 --- a/crates/shirabe/src/util/hg.rs +++ b/crates/shirabe/src/util/hg.rs @@ -2,6 +2,7 @@ use crate::config::Config; use crate::io::IOInterface; +use crate::io::IOInterfaceImmutable; use crate::util::ProcessExecutor; use crate::util::Url; use anyhow::Result; @@ -13,14 +14,14 @@ static VERSION: OnceLock> = OnceLock::new(); #[derive(Debug)] pub struct Hg { - io: Box, + io: std::rc::Rc>, config: std::rc::Rc>, process: std::rc::Rc>, } impl Hg { pub fn new( - io: &dyn IOInterface, + io: std::rc::Rc>, config: &Config, process: &std::rc::Rc>, ) -> Self { @@ -35,7 +36,7 @@ impl Hg { ) -> Result<()> { self.config.borrow_mut().prohibit_url_by_config( &url, - Some(&*self.io), + Some(&*self.io.borrow()), &indexmap::IndexMap::new(), )?; -- cgit v1.3.1