From 27267ed98fc839b51ae4621fd1aa230f7f068bdc Mon Sep 17 00:00:00 2001 From: David Blajda Date: Sun, 16 Dec 2018 20:24:36 +0000 Subject: Prototype of a non-trait based client --- src/helix/endpoints.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/helix/endpoints.rs') diff --git a/src/helix/endpoints.rs b/src/helix/endpoints.rs index 80b4ebb..a02bf73 100644 --- a/src/helix/endpoints.rs +++ b/src/helix/endpoints.rs @@ -8,19 +8,7 @@ use super::models::{DataContainer, PaginationContainer, User, Video, Clip}; use super::Client; const API_DOMAIN: &'static str = "api.twitch.tv"; -/* When Client owns a ReqwestClient, any futures spawned do not immediately - * terminate but 'hang'. When creating a new client for each request this problem - * does not occur. This would need to be resolved so we can benefit from keep alive - * connections. - */ - -use super::super::GetRequest; -use super::super::GetRequestRef; -use std::marker::PhantomData; - -use super::HelixClient; - -fn apply_standard_headers(client: &Box, request: RequestBuilder) +fn apply_standard_headers(client: Client, request: RequestBuilder) -> RequestBuilder { let client_header = header::HeaderValue::from_str(client.id()).unwrap(); @@ -28,7 +16,7 @@ fn apply_standard_headers(client: &Box, request: RequestBuilder request.header("Client-ID", client_header) } -pub fn clip(client: &Box, id: &str) +pub fn clip(client: Client, id: &str) -> impl Future, Error=reqwest::Error> { let url = -- cgit v1.2.3