Skip to content

Commit

Permalink
Release v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Nov 14, 2024
1 parent 49f090d commit 502a4e2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
11 changes: 5 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ license = "GPL-3.0"
name = "reqwew"
readme = "README.md"
repository = "https://github.com/hack-ink/reqwew"
version = "0.3.1"
version = "0.4.0"

[profile.ci-dev]
incremental = false
inherits = "dev"

[dependencies]
# crates.io
bytes = { version = "1.7" }
once_cell = { version = "1.19" }
bytes = { version = "1.8" }
reqwest = { version = "0.12" }
serde = { version = "1.0" }
serde_json = { version = "1.0" }
thiserror = { version = "1.0" }
tokio = { version = "1.40" }
thiserror = { version = "2.0" }
tokio = { version = "1.41" }
tracing = { version = "0.1" }

[dev-dependencies]
tokio = { version = "1.40", features = ["macros"] }
# crates.io
tokio = { version = "1.41", features = ["macros"] }
16 changes: 9 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ use error::*;

#[cfg(test)] mod test;

pub use once_cell;
pub use reqwest;

// std
use std::{future::Future, time::Duration};
use std::{future::Future, sync::LazyLock, time::Duration};
// crates.io
use bytes::Bytes;
use once_cell::sync::Lazy;
use reqwest::{Body, Client as RClient, IntoUrl, Method as RMethod};
use serde::de::DeserializeOwned;
use tokio::time;
Expand Down Expand Up @@ -380,10 +378,14 @@ impl Http for Client {
///
/// # Example
/// ```rust
/// use reqwew::{once_cell::sync::Lazy, Client};
/// use reqwew::Client;
/// use std::sync::LazyLock;
///
/// pub static CLIENT: Lazy<Client> = reqwew::lazy(|| Client::default());
/// pub static CLIENT: LazyLock<Client> = reqwew::lazy(|| Client::default());
/// ```
pub const fn lazy<F>(f: F) -> Lazy<Client, F> {
Lazy::new(f)
pub const fn lazy<F>(f: F) -> LazyLock<Client, F>
where
F: FnOnce() -> Client,
{
LazyLock::new(f)
}
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde_json::Value;
// self
use super::*;

static CLIENT: Lazy<Client> = lazy(Default::default);
static CLIENT: LazyLock<Client> = lazy(Default::default);

#[tokio::test]
async fn http_and_response_should_work() {
Expand Down

0 comments on commit 502a4e2

Please sign in to comment.