diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml
index 8d509d691..4231b4dc2 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.33.22
+ uses: taiki-e/install-action@v2.34.0
with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@@ -80,7 +80,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
- name: Install cargo-hack
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.34.0
with:
tool: cargo-hack
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 56333e187..ed2930bc6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,13 +54,17 @@ jobs:
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' >> $GITHUB_ENV
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
+ - name: Setup mold linker
+ if: matrix.target.os == 'ubuntu-latest'
+ uses: rui314/setup-mold@v1
+
- name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
toolchain: ${{ matrix.version.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.34.0
with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@@ -109,7 +113,7 @@ jobs:
toolchain: nightly
- name: Install just
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.34.0
with:
tool: just
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 943f63223..da892bd7a 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -22,16 +22,16 @@ jobs:
with:
components: llvm-tools-preview
- - name: Install cargo-llvm-cov
- uses: taiki-e/install-action@v2.33.22
+ - name: Install just,cargo-llvm-cov
+ uses: taiki-e/install-action@v2.34.0
with:
- tool: cargo-llvm-cov
+ tool: just,cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
- name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4.3.1
+ uses: codecov/codecov-action@v4.4.1
with:
files: codecov.json
fail_ci_if_error: true
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 03b25ecda..d7a16ccb4 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -79,10 +79,10 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
- toolchain: nightly-2024-04-26
+ toolchain: nightly-2024-06-07
- name: Install cargo-public-api
- uses: taiki-e/install-action@v2.33.22
+ uses: taiki-e/install-action@v2.34.0
with:
tool: cargo-public-api
diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml
deleted file mode 100644
index 6352e44d2..000000000
--- a/.github/workflows/upload-doc.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Upload Documentation
-
-on:
- push:
- branches: [master]
-
-permissions:
- contents: read
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- build:
- permissions:
- contents: write
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Install Rust
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
- with:
- toolchain: nightly
-
- - name: Build Docs
- run: cargo +nightly doc --no-deps --workspace --all-features
- env:
- RUSTDOCFLAGS: --cfg=docsrs
-
- - name: Tweak HTML
- run: echo '' > target/doc/index.html
-
- - name: Deploy to GitHub Pages
- uses: JamesIves/github-pages-deploy-action@v4.6.0
- with:
- folder: target/doc
- single-commit: true
diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md
index 993c7c596..e0390563c 100644
--- a/actix-web/CHANGES.md
+++ b/actix-web/CHANGES.md
@@ -2,6 +2,10 @@
## Unreleased
+### Added
+
+- Implement `From>` for `Error`.
+
## 4.6.0
### Added
diff --git a/actix-web/src/app.rs b/actix-web/src/app.rs
index 1a3b79086..3d86d1f9b 100644
--- a/actix-web/src/app.rs
+++ b/actix-web/src/app.rs
@@ -112,8 +112,8 @@ where
/// })
/// ```
#[doc(alias = "manage")]
- pub fn app_data(mut self, ext: U) -> Self {
- self.extensions.insert(ext);
+ pub fn app_data(mut self, data: U) -> Self {
+ self.extensions.insert(data);
self
}
diff --git a/actix-web/src/error/error.rs b/actix-web/src/error/error.rs
index 3a5a128f6..670a58a00 100644
--- a/actix-web/src/error/error.rs
+++ b/actix-web/src/error/error.rs
@@ -60,6 +60,12 @@ impl From for Error {
}
}
+impl From> for Error {
+ fn from(value: Box) -> Self {
+ Error { cause: value }
+ }
+}
+
impl From for Response {
fn from(err: Error) -> Response {
err.error_response().into()