1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-23 15:51:06 +01:00

migrate to doc_auto_cfg

This commit is contained in:
Rob Ede 2023-04-09 19:41:57 +01:00
parent 111d95eaea
commit f37c93a2a8
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
11 changed files with 25 additions and 41 deletions

View File

@ -3,8 +3,7 @@ name: CI (post-merge)
on:
push: { branches: [master] }
permissions:
contents: read # to fetch code (actions/checkout)
permissions: { contents: read }
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

View File

@ -4,8 +4,7 @@ on:
pull_request: {}
push: { branches: [master] }
permissions:
contents: read # to fetch code (actions/checkout)
permissions: { contents: read }
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -45,7 +44,8 @@ jobs:
with:
toolchain: ${{ matrix.version }}
- uses: taiki-e/cache-cargo-install-action@v1
- name: Install cargo-hack
uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }
- name: workaround MSRV issues
@ -97,10 +97,8 @@ jobs:
with:
toolchain: ${{ matrix.version }}
- uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }
- uses: taiki-e/cache-cargo-install-action@v1
- name: Install cargo-hack
uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }
- name: workaround MSRV issues

View File

@ -1,12 +1,9 @@
# disabled because `cargo tarpaulin` currently segfaults
name: Coverage
on:
push: { branches: [master] }
permissions:
contents: read # to fetch code (actions/checkout)
permissions: { contents: read }
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -26,20 +23,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install stable
run: |
rustup override set stable
rustup update stable
- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }
- name: Generate coverage file
run: |
cargo install cargo-tarpaulin --vers "^0.13"
cargo tarpaulin --workspace --out Xml --verbose
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with: { file: cobertura.xml }

View File

@ -2,8 +2,7 @@ name: Lint
on: [pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
permissions: { contents: read }
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -47,14 +46,18 @@ jobs:
- name: checkout ${{ github.head_ref }}
uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }
- uses: taiki-e/cache-cargo-install-action@v1
- name: Install cargo-public-api
uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-public-api }
- name: generate API diff
run: |
for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do
cargo public-api --manifest-path "$f" --all-features diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }}
cargo public-api --manifest-path "$f" --all-features diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }} >> /tmp/diff.txt
done
cat /tmp/diff.txt

View File

@ -3,8 +3,7 @@ name: Upload Documentation
on:
push: { branches: [master] }
permissions:
contents: read # to fetch code (actions/checkout)
permissions: { contents: write }
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -17,10 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
rustup override set nightly
rustup update nightly
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }
- name: Build Docs
run: cargo doc --workspace --all-features --no-deps

View File

@ -431,7 +431,6 @@ impl Cors {
///
/// [Private Network Access]: https://wicg.github.io/local-network-access
#[cfg(feature = "draft-local-network-access")]
#[cfg_attr(docsrs, doc(cfg(feature = "draft-local-network-access")))]
pub fn allow_local_network_access(mut self) -> Cors {
if let Some(cors) = cors(&mut self.inner, &self.error) {
cors.allow_local_network_access = true;

View File

@ -53,7 +53,7 @@
#![warn(future_incompatible, missing_docs, missing_debug_implementations)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod all_or_some;
mod builder;

View File

@ -138,7 +138,7 @@
#![warn(future_incompatible, missing_docs)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod config;
mod middleware;

View File

@ -47,7 +47,6 @@ use crate::storage::{
/// storage backend.
///
/// [`CookieContentSecurity::Private`]: crate::config::CookieContentSecurity::Private
#[cfg_attr(docsrs, doc(cfg(feature = "cookie-session")))]
#[derive(Default)]
#[non_exhaustive]
pub struct CookieSessionStore;

View File

@ -53,7 +53,6 @@ use crate::storage::{
/// Redis. Use [`RedisSessionStore`] if you need TLS support.
///
/// [`RedisSessionStore`]: crate::storage::RedisSessionStore
#[cfg_attr(docsrs, doc(cfg(feature = "redis-actor-session")))]
pub struct RedisActorSessionStore {
configuration: CacheConfiguration,
addr: Addr<RedisActor>,
@ -93,7 +92,6 @@ impl Default for CacheConfiguration {
/// A fluent builder to construct a [`RedisActorSessionStore`] instance with custom configuration
/// parameters.
#[cfg_attr(docsrs, doc(cfg(feature = "redis-actor-session")))]
#[must_use]
pub struct RedisActorSessionStoreBuilder {
connection_string: String,

View File

@ -60,7 +60,6 @@ use crate::storage::{
/// `RedisSessionStore` leverages [`redis-rs`] as Redis client.
///
/// [`redis-rs`]: https://github.com/mitsuhiko/redis-rs
#[cfg_attr(docsrs, doc(cfg(feature = "redis-rs-session")))]
#[derive(Clone)]
pub struct RedisSessionStore {
configuration: CacheConfiguration,
@ -105,7 +104,6 @@ impl RedisSessionStore {
/// parameters.
///
/// [`RedisSessionStore`]: crate::storage::RedisSessionStore
#[cfg_attr(docsrs, doc(cfg(feature = "redis-rs-session")))]
#[must_use]
pub struct RedisSessionStoreBuilder {
connection_string: String,