Skip to content

Commit

Permalink
Release v0.3.1
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Lau <[email protected]>
  • Loading branch information
AurevoirXavier committed Sep 11, 2024
1 parent ae8ab5b commit 16afafc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0"
name = "reqwew"
readme = "README.md"
repository = "https://github.com/hack-ink/reqwew"
version = "0.3.0"
version = "0.3.1"

[profile.ci-dev]
incremental = false
Expand Down
21 changes: 18 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ where
) -> impl Future<Output = Result<Bytes>> + Send
where
U: Send + IntoUrl,
B: Send + Clone + Into<Body>,
B: Clone + Send + Into<Body>,
{
async move {
let u = uri.as_str();
Expand Down Expand Up @@ -145,7 +145,7 @@ where
) -> impl Future<Output = Result<Bytes>> + Send
where
U: Send + IntoUrl,
B: Send + Clone + Into<Body>,
B: Clone + Send + Into<Body>,
{
self.request_with_retries(uri, Method::Post, Some(body), retries, retry_delay_ms)
}
Expand All @@ -159,6 +159,21 @@ where
self.request(uri, Method::Put, Some(body))
}

/// Perform a PUT request with retries.
fn put_with_retries<U, B>(
&self,
uri: U,
body: B,
retries: u32,
retry_delay_ms: u64,
) -> impl Future<Output = Result<Bytes>> + Send
where
U: Send + IntoUrl,
B: Clone + Send + Into<Body>,
{
self.request_with_retries(uri, Method::Put, Some(body), retries, retry_delay_ms)
}

/// Perform a DELETE request.
fn delete<U>(&self, uri: U) -> impl Future<Output = Result<Bytes>> + Send
where
Expand Down Expand Up @@ -262,7 +277,7 @@ where
) -> impl Future<Output = Result<Bytes>> + Send
where
U: Send + IntoUrl,
B: Send + Clone + Into<Body>,
B: Clone + Send + Into<Body>,
{
self.request_with_retries(uri, Method::Patch, Some(body), retries, retry_delay_ms)
}
Expand Down

0 comments on commit 16afafc

Please sign in to comment.