pub(crate) fn parse_token_response_raw(
    resp: &HttpResponse,
) -> Result<&HttpResponse, RequestParseError> {
    match serde_json::from_slice::<TwitchTokenErrorResponse>(resp.body()) {
        Err(_) => match resp.status() {
            StatusCode::OK => Ok(resp),
            _ => Err(RequestParseError::Other(resp.status())),
        },
        Ok(twitch_err) => Err(RequestParseError::TwitchError(twitch_err)),
    }
}
/// Parses a response, validating it and returning the response if all ok.
Parses a response, validating it and returning the response if all ok.
Parses a response validating it and returning the response if all ok .
pub(crate) fn parse_token_response_raw(
    resp: &HttpResponse,
) -> Result<&HttpResponse, RequestParseError> {
    match serde_json::from_slice::<TwitchTokenErrorResponse>(resp.body()) {
        Err(_) => match resp.status() {
            StatusCode::OK => Ok(resp),
            _ => Err(RequestParseError::Other(resp.status())),
        },
        Ok(twitch_err) => Err(RequestParseError::TwitchError(twitch_err)),
    }
}
pub ( crate ) fn parse_token_response_raw ( resp : & HttpResponse , ) -> Result < & HttpResponse , RequestParseError > { match serde_json :: from_slice :: < TwitchTokenErrorResponse > ( resp . body ( ) ) { Err ( _ ) => match resp . status ( ) { StatusCode :: OK => Ok ( resp ) , _ => Err ( RequestParseError :: Other ( resp . status ( ) ) ) , } , Ok ( twitch_err ) => Err ( RequestParseError :: TwitchError ( twitch_err ) ) , } }
Parses a response, validating it and returning the response if all ok.
Parses a response validating it and returning the response if all ok .
resp
&HttpResponse