torn-api.rs/torn-api/src/reqwest.rs
2022-09-18 23:48:36 +02:00

13 lines
288 B
Rust

use async_trait::async_trait;
use crate::send::ApiClient;
#[async_trait]
impl ApiClient for reqwest::Client {
type Error = reqwest::Error;
async fn request(&self, url: String) -> Result<serde_json::Value, Self::Error> {
self.get(url).send().await?.json().await
}
}