~aleteoryx/lfm_embed

ref: 94ecd2bba5fb5207d7ea241a8b5762bc2e1376f9 lfm_embed/src/http.rs -rw-r--r-- 326 bytes
94ecd2bbalyx Add SPDX info to all files 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
// SPDX-License-Identifier: AGPL-3.0-only
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<Client> {
  LazyLock::new(new)
}