0.3.0
What's Changed
You can now customise your client and bring your own reqwest
client (to configure you own custom timeouts or headers) and change the default base URL (e.g. for local testing)
use lastfm::ClientBuilder;
use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = env::var("LASTFM_API_KEY")?;
let mut client_builder = ClientBuilder::new(api_key, "loige".to_string());
client_builder.reqwest_client(reqwest::Client::new());
client_builder.base_url("http://localhost:8080".parse().unwrap());
let client = client_builder.build();
// do something with client...
Ok(())
}
Full Changelog: 0.2.0...0.3.0