Skip to content

0.3.0

Compare
Choose a tag to compare
@lmammino lmammino released this 23 Apr 23:23
· 17 commits to main since this release

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