lowestbins 1.4.1

Lowestbins made in rust for maximum efficiency
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use isahc::AsyncReadResponseExt;
use serde::de::DeserializeOwned;

use crate::{error, API_URL, HTTP_CLIENT};

pub async fn get_path<T: DeserializeOwned>(path: &'_ str) -> error::Result<T> {
    #[allow(unused_mut)]
    let mut text = HTTP_CLIENT
        .get_async(format!("{API_URL}/skyblock/{path}", API_URL = *API_URL))
        .await?
        .bytes()
        .await?;

    #[cfg(feature = "simd")]
    return Ok(simd_json::from_slice(&mut text)?);
    #[cfg(not(feature = "simd"))]
    return Ok(serde_json::from_slice(&text)?);
}