aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/github_driver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-06 19:47:36 +0900
committernsfisis <nsfisis@gmail.com>2026-06-06 19:47:36 +0900
commitaf4b9fcba1206e3fcc97fc243ffc674f85547942 (patch)
tree7066e219d80024150919316af900c666957a64fb /crates/shirabe/src/repository/vcs/github_driver.rs
parentd9090c4c52fa29ee1569aedf8be858bf78001d7b (diff)
downloadphp-shirabe-af4b9fcba1206e3fcc97fc243ffc674f85547942.tar.gz
php-shirabe-af4b9fcba1206e3fcc97fc243ffc674f85547942.tar.zst
php-shirabe-af4b9fcba1206e3fcc97fc243ffc674f85547942.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs/github_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/github_driver.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs
index 076f4a0..093cd03 100644
--- a/crates/shirabe/src/repository/vcs/github_driver.rs
+++ b/crates/shirabe/src/repository/vcs/github_driver.rs
@@ -1046,16 +1046,12 @@ impl GitHubDriver {
self.attempt_clone_fallback(Some(&e))
.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());
+ ));
}
let mut scopes_issued: Vec<String> = vec![];
@@ -1112,16 +1108,12 @@ impl GitHubDriver {
self.attempt_clone_fallback(Some(&e))
.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());
+ ));
}
let rate_limited = git_hub_util