From 783f92c18253ac1104b8de634dfd1f66eb049467 Mon Sep 17 00:00:00 2001 From: Antonios Barotsis Date: Sun, 16 Jun 2024 17:17:14 +0300 Subject: [PATCH 1/3] Rename `RESEND_RATE_LIMIT` --- README.md | 2 +- src/config.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c3bddf..ba4af80 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Crate documentation is available in [docsrs][docs-url]. Example usage is availab - `RESEND_API_KEY` to enable `impl Default` for a `Resend` client (Required). - `RESEND_BASE_URL` to override the default base address: `https://api.resend.com` (Optional). -- `RATE_LIMIT` to set the maximum amount of requests you can send per second. By default, this is +- `RESEND_RATE_LIMIT` to set the maximum amount of requests you can send per second. By default, this is 9 (Resend defaults to 10). In reality, the time window is set to 1.1s to avoid failures. This is thread-safe (as long as you use the same `Resend` client across threads!) diff --git a/src/config.rs b/src/config.rs index 9d2f8b2..22f967f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -40,10 +40,10 @@ impl Config { // ==== Rate limiting is a non-blocking thing only ==== #[cfg(not(feature = "blocking"))] - let rate_limit_per_sec = env::var("RATE_LIMIT") + let rate_limit_per_sec = env::var("RESEND_RATE_LIMIT") .unwrap_or_else(|_| "9".to_owned()) .parse::() - .expect("env variable `RATE_LIMIT` should be a valid u32"); + .expect("env variable `RESEND_RATE_LIMIT` should be a valid u32"); #[cfg(not(feature = "blocking"))] let quota = Quota::with_period(Duration::from_millis(1100)) From 18474bf2cea8fd971ac3b06a8885724d47e452fa Mon Sep 17 00:00:00 2001 From: Antonios Barotsis Date: Sun, 16 Jun 2024 17:17:26 +0300 Subject: [PATCH 2/3] Remove old doc comment --- src/client.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/client.rs b/src/client.rs index ee4290e..e106496 100644 --- a/src/client.rs +++ b/src/client.rs @@ -61,10 +61,6 @@ impl Resend { } /// Returns the reference to the used `User-Agent` header value. - /// - /// ### Notes - /// - /// Use the `RESEND_USER_AGENT` environment variable to override. #[inline] #[must_use] pub fn user_agent(&self) -> &str { From f9ec24e6e02ebab42387b5d16aaf1e8947816dd8 Mon Sep 17 00:00:00 2001 From: Antonios Barotsis Date: Sun, 16 Jun 2024 17:17:32 +0300 Subject: [PATCH 3/3] Prep release --- CHANGELOG.md | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f91158..81ddef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ and this project adheres to +## [0.6.0] - 2024-06-16 + +### Changed + +- `RATE_LIMIT` to `RESEND_RATE_LIMIT` to avoid potential collisions with other libs + +### Removed + +- Outdated doc comment from `Client::user_agent` + ## [0.5.2] - 2024-06-10 ### Added @@ -93,6 +103,7 @@ Disabled `reqwest`'s default features and enabled `rustls-tls`. Initial release. +[0.6.0]: https://crates.io/crates/resend-rs/0.6.0 [0.5.2]: https://crates.io/crates/resend-rs/0.5.2 [0.5.1]: https://crates.io/crates/resend-rs/0.5.1 [0.5.0]: https://crates.io/crates/resend-rs/0.5.0 diff --git a/Cargo.toml b/Cargo.toml index b018db4..9277565 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "resend-rs" -version = "0.5.2" +version = "0.6.0" edition = "2021" license = "MIT"