From a9f497d05f259e91370b7c8ac5161adf958f5d13 Mon Sep 17 00:00:00 2001 From: Luca Palmieri Date: Fri, 28 Jan 2022 17:28:16 +0000 Subject: [PATCH] Guard against broken intra-doc links in CI (#2616) --- .github/workflows/clippy-fmt.yml | 18 ++++++++++++++++++ actix-files/src/named.rs | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clippy-fmt.yml b/.github/workflows/clippy-fmt.yml index 9fcb0a561..9f5a0570a 100644 --- a/.github/workflows/clippy-fmt.yml +++ b/.github/workflows/clippy-fmt.yml @@ -5,6 +5,24 @@ on: types: [opened, synchronize, reopened] jobs: + lint-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: rust-docs + - name: Check for broken intra-doc links + uses: actions-rs/cargo@v1 + env: + RUSTDOCFLAGS: "-D warnings" + with: + command: doc + args: --no-deps --all-features --workspace + fmt: runs-on: ubuntu-latest steps: diff --git a/actix-files/src/named.rs b/actix-files/src/named.rs index 14495e660..cb6875065 100644 --- a/actix-files/src/named.rs +++ b/actix-files/src/named.rs @@ -209,6 +209,7 @@ impl NamedFile { Self::from_file(file, path) } + #[allow(rustdoc::broken_intra_doc_links)] /// Attempts to open a file asynchronously in read-only mode. /// /// When the `experimental-io-uring` crate feature is enabled, this will be async. @@ -300,7 +301,7 @@ impl NamedFile { /// Set content encoding for serving this file /// - /// Must be used with [`actix_web::middleware::Compress`] to take effect. + /// Must be used with `actix_web::middleware::Compress` to take effect. #[inline] pub fn set_content_encoding(mut self, enc: ContentEncoding) -> Self { self.encoding = Some(enc);