Skip to content

Commit

Permalink
Merge pull request #7 from resend/0.6.0
Browse files Browse the repository at this point in the history
0.6.0
  • Loading branch information
AntoniosBarotsis authored Jun 16, 2024
2 parents 114e200 + f9ec24e commit 75025d6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ and this project adheres to

<!-- ## [Unreleased] -->

## [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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "resend-rs"
version = "0.5.2"
version = "0.6.0"
edition = "2021"

license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!)

Expand Down
4 changes: 0 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u32>()
.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))
Expand Down

0 comments on commit 75025d6

Please sign in to comment.