Compare commits

...

4 Commits

Author SHA1 Message Date
n4n5 dba5f1e416
Merge a6b720332d into 60c50cdea2 2024-04-25 20:00:45 +00:00
n4n5 a6b720332d
Update CHANGELOG.md
Co-authored-by: Daniel Abramov <inetcrack2@gmail.com>
2024-04-25 22:00:43 +02:00
n4n5 2996d4d709
Update Cargo.toml
Co-authored-by: Daniel Abramov <inetcrack2@gmail.com>
2024-04-25 22:00:39 +02:00
Bartel Sielski 60c50cdea2
handshake(server): Make 'create_response_with_body' function more generic
This makes using it possible when the request and response body types differ.

Signed-off-by: bartel <bartel.sielski@gmail.com>
2024-04-23 16:45:36 +02:00
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
# 0.22.0
- Make `url::Url` as feature
- Add Header and subprotocol support at creation
- Make `url` optional.
- Add a builder for convenient headers and subprotocols construction.
# 0.21.0
- Fix read-predominant auto pong responses not flushing when hitting WouldBlock errors.

View File

@ -7,7 +7,7 @@ authors = ["Alexey Galakhov", "Daniel Abramov"]
license = "MIT OR Apache-2.0"
readme = "README.md"
homepage = "https://github.com/snapview/tungstenite-rs"
documentation = "https://docs.rs/tungstenite/0.21.0"
documentation = "https://docs.rs/tungstenite/0.22.0"
repository = "https://github.com/snapview/tungstenite-rs"
version = "0.22.0"
edition = "2018"

View File

@ -86,10 +86,10 @@ pub fn create_response(request: &Request) -> Result<Response> {
}
/// Create a response for the request with a custom body.
pub fn create_response_with_body<T>(
request: &HttpRequest<T>,
generate_body: impl FnOnce() -> T,
) -> Result<HttpResponse<T>> {
pub fn create_response_with_body<T1, T2>(
request: &HttpRequest<T1>,
generate_body: impl FnOnce() -> T2,
) -> Result<HttpResponse<T2>> {
Ok(create_parts(request)?.body(generate_body())?)
}