From f61fcbe8407019ad6ec958ab78ef2401f2ccd68f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:12:48 +0100 Subject: [PATCH 1/3] build(deps): bump taiki-e/install-action from 2.42.17 to 2.42.22 (#3451) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.42.17 to 2.42.22. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.42.17...v2.42.22) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index c1afdb1cc..f94f0b20b 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.9.0 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f98e17a87..f4a526e38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f30c8ff42..8282ac18e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f3bdb3515..d105b67d5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -76,7 +76,7 @@ jobs: toolchain: nightly-2024-05-01 - name: Install just - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: just @@ -105,7 +105,7 @@ jobs: toolchain: nightly-2024-06-07 - name: Install cargo-public-api - uses: taiki-e/install-action@v2.42.17 + uses: taiki-e/install-action@v2.42.22 with: tool: cargo-public-api From 4303dd8c37f1e320a861e79ca27637633e2e6eb8 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 18 Aug 2024 14:10:33 +0100 Subject: [PATCH 2/3] docs(web): mention try_init_service --- actix-web/src/test/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/actix-web/src/test/mod.rs b/actix-web/src/test/mod.rs index 5e647956b..701771588 100644 --- a/actix-web/src/test/mod.rs +++ b/actix-web/src/test/mod.rs @@ -1,7 +1,8 @@ //! Various helpers for Actix applications to use during testing. //! -//! # Creating A Test Service +//! # Initializing A Test Service //! - [`init_service`] +//! - [`try_init_service`] //! //! # Off-The-Shelf Test Services //! - [`ok_service`] @@ -49,6 +50,7 @@ pub use self::{ /// Must be used inside an async test. Works for both `ServiceRequest` and `HttpRequest`. /// /// # Examples +/// /// ``` /// use actix_web::{http::StatusCode, HttpResponse}; /// From 78ac5cf4829dd923b88c52145f509ec74b34a41a Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 18 Aug 2024 14:33:28 +0100 Subject: [PATCH 3/3] docs(web): unmention try_init_service --- actix-http/examples/actix-web.rs | 4 ++-- actix-http/examples/echo.rs | 5 ++--- actix-http/examples/hello-world.rs | 2 +- actix-http/examples/streaming-error.rs | 6 +++--- actix-http/examples/ws.rs | 7 +++---- actix-web/src/test/mod.rs | 1 - 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/actix-http/examples/actix-web.rs b/actix-http/examples/actix-web.rs index 449e5899b..e07abfd97 100644 --- a/actix-http/examples/actix-web.rs +++ b/actix-http/examples/actix-web.rs @@ -1,10 +1,10 @@ use actix_http::HttpService; use actix_server::Server; use actix_service::map_config; -use actix_web::{dev::AppConfig, get, App}; +use actix_web::{dev::AppConfig, get, App, Responder}; #[get("/")] -async fn index() -> &'static str { +async fn index() -> impl Responder { "Hello, world. From Actix Web!" } diff --git a/actix-http/examples/echo.rs b/actix-http/examples/echo.rs index ae6f00cce..11fd2750e 100644 --- a/actix-http/examples/echo.rs +++ b/actix-http/examples/echo.rs @@ -23,7 +23,7 @@ async fn main() -> io::Result<()> { body.extend_from_slice(&item?); } - info!("request body: {:?}", body); + info!("request body: {body:?}"); let res = Response::build(StatusCode::OK) .insert_header(("x-head", HeaderValue::from_static("dummy value!"))) @@ -31,8 +31,7 @@ async fn main() -> io::Result<()> { Ok::<_, Error>(res) }) - // No TLS - .tcp() + .tcp() // No TLS })? .run() .await diff --git a/actix-http/examples/hello-world.rs b/actix-http/examples/hello-world.rs index cf10beddf..afa3883a4 100644 --- a/actix-http/examples/hello-world.rs +++ b/actix-http/examples/hello-world.rs @@ -17,7 +17,7 @@ async fn main() -> io::Result<()> { ext.insert(42u32); }) .finish(|req: Request| async move { - info!("{:?}", req); + info!("{req:?}"); let mut res = Response::build(StatusCode::OK); res.insert_header(("x-head", HeaderValue::from_static("dummy value!"))); diff --git a/actix-http/examples/streaming-error.rs b/actix-http/examples/streaming-error.rs index 8c8a249cb..39f214fa1 100644 --- a/actix-http/examples/streaming-error.rs +++ b/actix-http/examples/streaming-error.rs @@ -22,16 +22,16 @@ async fn main() -> io::Result<()> { .bind("streaming-error", ("127.0.0.1", 8080), || { HttpService::build() .finish(|req| async move { - info!("{:?}", req); + info!("{req:?}"); let res = Response::ok(); Ok::<_, Infallible>(res.set_body(BodyStream::new(stream! { yield Ok(Bytes::from("123")); yield Ok(Bytes::from("456")); - actix_rt::time::sleep(Duration::from_millis(1000)).await; + actix_rt::time::sleep(Duration::from_secs(1)).await; - yield Err(io::Error::new(io::ErrorKind::Other, "")); + yield Err(io::Error::new(io::ErrorKind::Other, "abc")); }))) }) .tcp() diff --git a/actix-http/examples/ws.rs b/actix-http/examples/ws.rs index fb86bc5ea..af83e4c3d 100644 --- a/actix-http/examples/ws.rs +++ b/actix-http/examples/ws.rs @@ -17,7 +17,6 @@ use bytes::{Bytes, BytesMut}; use bytestring::ByteString; use futures_core::{ready, Stream}; use tokio_util::codec::Encoder; -use tracing::{info, trace}; #[actix_rt::main] async fn main() -> io::Result<()> { @@ -37,12 +36,12 @@ async fn main() -> io::Result<()> { } async fn handler(req: Request) -> Result>, Error> { - info!("handshaking"); + tracing::info!("handshaking"); let mut res = ws::handshake(req.head())?; // handshake will always fail under HTTP/2 - info!("responding"); + tracing::info!("responding"); res.message_body(BodyStream::new(Heartbeat::new(ws::Codec::new()))) } @@ -64,7 +63,7 @@ impl Stream for Heartbeat { type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - trace!("poll"); + tracing::trace!("poll"); ready!(self.as_mut().interval.poll_tick(cx)); diff --git a/actix-web/src/test/mod.rs b/actix-web/src/test/mod.rs index 701771588..86cb60956 100644 --- a/actix-web/src/test/mod.rs +++ b/actix-web/src/test/mod.rs @@ -2,7 +2,6 @@ //! //! # Initializing A Test Service //! - [`init_service`] -//! - [`try_init_service`] //! //! # Off-The-Shelf Test Services //! - [`ok_service`]