From 98073a37bd7e3cb961dc9d9965ae56d591ec8c08 Mon Sep 17 00:00:00 2001 From: pyrite Date: Wed, 28 May 2025 10:19:43 +0200 Subject: [PATCH] fix(torn-api): fix request parameter encoding --- torn-api/src/request/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/torn-api/src/request/mod.rs b/torn-api/src/request/mod.rs index a5a7245..15ac0a0 100644 --- a/torn-api/src/request/mod.rs +++ b/torn-api/src/request/mod.rs @@ -14,7 +14,13 @@ impl ApiRequest { pub fn url(&self) -> String { let mut url = format!("https://api.torn.com/v2{}?", self.path); + let mut first = true; for (name, value) in &self.parameters { + if first { + first = false; + } else { + url.push('&'); + } url.push_str(&format!("{name}={value}")); }