From aa13cfac108007fb522696aeb0c675c492459b6f Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 21 Jun 2023 00:23:12 +0200 Subject: [PATCH] chore: return request builder --- src/model/request.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/model/request.rs b/src/model/request.rs index 65760d1..fae03fb 100644 --- a/src/model/request.rs +++ b/src/model/request.rs @@ -13,17 +13,17 @@ fn fill_from_env(mut txt: String) -> String { } pub trait IntoRequest { - fn make_request(&self) -> reqwest::Request; + fn make_request(&self) -> reqwest::RequestBuilder; } impl IntoRequest for v2_0_0::RequestClass { - fn make_request(&self) -> reqwest::Request { + fn make_request(&self) -> reqwest::RequestBuilder { todo!() } } impl IntoRequest for v2_1_0::RequestClass { - fn make_request(&self) -> reqwest::Request { + fn make_request(&self) -> reqwest::RequestBuilder { let method = reqwest::Method::from_bytes( &self.method.as_ref().unwrap_or(&"GET".into()).as_bytes() // TODO lol? ).unwrap_or(reqwest::Method::GET); // TODO throw an error rather than replacing it silently @@ -74,12 +74,12 @@ impl IntoRequest for v2_1_0::RequestClass { _ => {}, } - out.build().unwrap() // TODO what about this? + out } } impl IntoRequest for v1_0_0::Request { - fn make_request(&self) -> reqwest::Request { + fn make_request(&self) -> reqwest::RequestBuilder { todo!() } }