From 83ba4fe37a1184b998be09b9cbe53a22c7ba9e3b Mon Sep 17 00:00:00 2001 From: alyx Date: Mon, 1 Apr 2024 20:27:44 -0400 Subject: Move caching to src/cache/; Finalize API parsing fixes Font and user cache code has been moved to special files, independant from src/config.rs API parsing changes have been properly tested, and last.fm API JSON is now trace-logged for debugging convenience. --- src/http.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/http.rs (limited to 'src/http.rs') diff --git a/src/http.rs b/src/http.rs new file mode 100644 index 0000000..f0a609b --- /dev/null +++ b/src/http.rs @@ -0,0 +1,9 @@ +use std::sync::LazyLock; +use reqwest::Client; + +pub(crate) fn new() -> Client { + Client::builder().https_only(true).user_agent(concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"))).build().unwrap() +} +pub(crate) const fn lazy() -> LazyLock { + LazyLock::new(new) +} -- cgit v1.2.3-54-g00ecf