1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-20 01:08:10 +00:00

tweak set_content_encoding docs

This commit is contained in:
Rob Ede 2022-01-28 20:27:16 +00:00
parent a9f497d05f
commit 21a08ca796
No known key found for this signature in database
GPG key ID: 97C636207D3EF933
2 changed files with 22 additions and 20 deletions

View file

@ -5,24 +5,6 @@ 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:
@ -64,3 +46,21 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --tests --examples --all-features
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

View file

@ -299,9 +299,11 @@ impl NamedFile {
self
}
/// Set content encoding for serving this file
/// Sets content encoding for this file.
///
/// Must be used with `actix_web::middleware::Compress` to take effect.
/// This prevents the `Compress` middleware from modifying the file contents and signals to
/// browsers/clients how to decode it. For example, if serving a compressed HTML file (e.g.,
/// `index.html.gz`) then use `.set_content_encoding(ContentEncoding::Gzip)`.
#[inline]
pub fn set_content_encoding(mut self, enc: ContentEncoding) -> Self {
self.encoding = Some(enc);