fix changelog

This commit is contained in:
Rob Ede 2021-12-04 21:19:54 +00:00
parent 7b39da96e4
commit dd985490c8
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
3 changed files with 26 additions and 26 deletions

View File

@ -10,6 +10,7 @@
* Impl `MessageBody` for `bytestring::ByteString`. [#2468] * Impl `MessageBody` for `bytestring::ByteString`. [#2468]
* `impl Clone for ws::HandshakeError`. [#2468] * `impl Clone for ws::HandshakeError`. [#2468]
* `#[must_use]` for `ws::Codec` to prevent subtle bugs. [#1920] * `#[must_use]` for `ws::Codec` to prevent subtle bugs. [#1920]
* `impl Default ` for `ws::Codec`. [#1920]
### Changed ### Changed
* Rename `body::BoxBody::{from_body => new}`. [#2468] * Rename `body::BoxBody::{from_body => new}`. [#2468]
@ -19,7 +20,6 @@
* `From` implementations on error types now return a `Response<BoxBody>`. [#2468] * `From` implementations on error types now return a `Response<BoxBody>`. [#2468]
* `ResponseBuilder::body(B)` now returns `Response<EitherBody<B>>`. [#2468] * `ResponseBuilder::body(B)` now returns `Response<EitherBody<B>>`. [#2468]
* `ResponseBuilder::finish()` now returns `Response<EitherBody<()>>`. [#2468] * `ResponseBuilder::finish()` now returns `Response<EitherBody<()>>`. [#2468]
* `impl Copy` for `ws::Codec`. [#1920]
### Removed ### Removed
* `ResponseBuilder::streaming`. [#2468] * `ResponseBuilder::streaming`. [#2468]

View File

@ -90,7 +90,7 @@ impl Codec {
/// Set max frame size. /// Set max frame size.
/// ///
/// By default max size is set to 64KiB. /// By default max size is set to 64KiB.
#[must_use = "this returns the a new Codec, without modifying the original"] #[must_use = "This returns the a new Codec, without modifying the original."]
pub fn max_size(mut self, size: usize) -> Self { pub fn max_size(mut self, size: usize) -> Self {
self.max_size = size; self.max_size = size;
self self
@ -99,7 +99,7 @@ impl Codec {
/// Set decoder to client mode. /// Set decoder to client mode.
/// ///
/// By default decoder works in server mode. /// By default decoder works in server mode.
#[must_use = "this returns the a new Codec, without modifying the original"] #[must_use = "This returns the a new Codec, without modifying the original."]
pub fn client_mode(mut self) -> Self { pub fn client_mode(mut self) -> Self {
self.flags.remove(Flags::SERVER); self.flags.remove(Flags::SERVER);
self self

View File

@ -55,7 +55,7 @@ async fn common_test_code(mut srv: actix_test::TestServer, frame_size: usize) {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder() { async fn simple_builder() {
let srv = actix_test::start(|| { let srv = actix_test::start(|| {
App::new().service(web::resource("/").to( App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move { |req: HttpRequest, stream: web::Payload| async move {
@ -68,7 +68,7 @@ async fn test_builder() {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder_with_frame_size() { async fn builder_with_frame_size() {
let srv = actix_test::start(|| { let srv = actix_test::start(|| {
App::new().service(web::resource("/").to( App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move { |req: HttpRequest, stream: web::Payload| async move {
@ -83,7 +83,7 @@ async fn test_builder_with_frame_size() {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder_with_frame_size_exceeded() { async fn builder_with_frame_size_exceeded() {
const MAX_FRAME_SIZE: usize = 64; const MAX_FRAME_SIZE: usize = 64;
let mut srv = actix_test::start(|| { let mut srv = actix_test::start(|| {
@ -112,7 +112,7 @@ async fn test_builder_with_frame_size_exceeded() {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder_with_codec() { async fn builder_with_codec() {
let srv = actix_test::start(|| { let srv = actix_test::start(|| {
App::new().service(web::resource("/").to( App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move { |req: HttpRequest, stream: web::Payload| async move {
@ -127,7 +127,7 @@ async fn test_builder_with_codec() {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder_with_protocols() { async fn builder_with_protocols() {
let srv = actix_test::start(|| { let srv = actix_test::start(|| {
App::new().service(web::resource("/").to( App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move { |req: HttpRequest, stream: web::Payload| async move {
@ -142,7 +142,23 @@ async fn test_builder_with_protocols() {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder_full() { async fn builder_with_codec_and_frame_size() {
let srv = actix_test::start(|| {
App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move {
ws::WsResponseBuilder::new(Ws, &req, stream)
.codec(Codec::new())
.frame_size(MAX_FRAME_SIZE)
.start()
},
))
});
common_test_code(srv, DEFAULT_FRAME_SIZE).await;
}
#[actix_rt::test]
async fn builder_full() {
let srv = actix_test::start(|| { let srv = actix_test::start(|| {
App::new().service(web::resource("/").to( App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move { |req: HttpRequest, stream: web::Payload| async move {
@ -159,23 +175,7 @@ async fn test_builder_full() {
} }
#[actix_rt::test] #[actix_rt::test]
async fn test_builder_with_codec_and_frame_size() { async fn simple_start() {
let srv = actix_test::start(|| {
App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move {
ws::WsResponseBuilder::new(Ws, &req, stream)
.codec(Codec::new())
.frame_size(MAX_FRAME_SIZE)
.start()
},
))
});
common_test_code(srv, DEFAULT_FRAME_SIZE).await;
}
#[actix_rt::test]
async fn test_simple() {
let srv = actix_test::start(|| { let srv = actix_test::start(|| {
App::new().service(web::resource("/").to( App::new().service(web::resource("/").to(
|req: HttpRequest, stream: web::Payload| async move { ws::start(Ws, &req, stream) }, |req: HttpRequest, stream: web::Payload| async move { ws::start(Ws, &req, stream) },