From af4b9fcba1206e3fcc97fc243ffc674f85547942 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 19:47:36 +0900 Subject: refactor(http-response): take url directly instead of request map Response only ever reads the url out of the request array, so accept it as a String directly. With url always present the 'url key missing' LogicException can no longer fire, so Response::new and CurlResponse::new return Self instead of a double Result. Also drops the unused from_php_mixed/to_php_mixed stubs and the request_to_map helper. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/repository/vcs/gitlab_driver.rs | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'crates/shirabe/src/repository/vcs/gitlab_driver.rs') diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs index 6f2c4e9..3e2cd38 100644 --- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs +++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs @@ -841,16 +841,12 @@ impl GitLabDriver { self.attempt_clone_fallback() .map_err(|e| TransportException::new(e.to_string(), 0))?; - let mut req = IndexMap::new(); - req.insert("url".to_string(), PhpMixed::String("dummy".to_string())); return Ok(Response::new( - req, + "dummy".to_string(), Some(200), vec![], Some("null".to_string()), - ) - .unwrap() - .unwrap()); + )); } } @@ -919,16 +915,12 @@ impl GitLabDriver { self.attempt_clone_fallback() .map_err(|err| TransportException::new(err.to_string(), 0))?; - let mut req = IndexMap::new(); - req.insert("url".to_string(), PhpMixed::String("dummy".to_string())); return Ok(Response::new( - req, + "dummy".to_string(), Some(200), vec![], Some("null".to_string()), - ) - .unwrap() - .unwrap()); + )); } self.inner.io.write_error3( &format!( @@ -960,16 +952,12 @@ impl GitLabDriver { self.attempt_clone_fallback() .map_err(|err| TransportException::new(err.to_string(), 0))?; - let mut req = IndexMap::new(); - req.insert("url".to_string(), PhpMixed::String("dummy".to_string())); return Ok(Response::new( - req, + "dummy".to_string(), Some(200), vec![], Some("null".to_string()), - ) - .unwrap() - .unwrap()); + )); } Err(e) -- cgit v1.3.1