diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5860558..5cbc2bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,7 @@ jobs: needs: - test - lint + - check-feature-flags - publish-check runs-on: ubuntu-latest steps: @@ -109,3 +110,29 @@ jobs: with: command: publish args: --manifest-path lychee-bin/Cargo.toml + + check-feature-flags: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Check that rustls-tls feature doesn't depend on OpenSSL + shell: bash + run: | + ! cargo tree --package lychee --no-default-features --features rustls-tls -i openssl-sys + - name: Run cargo check with default features + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets + - name: Run cargo check with all features + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets --all-features + - name: Run cargo check with rustls-tls feature + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets --no-default-features --features rustls-tls diff --git a/lychee-bin/src/main.rs b/lychee-bin/src/main.rs index 0a56fc5..d056adb 100644 --- a/lychee-bin/src/main.rs +++ b/lychee-bin/src/main.rs @@ -73,7 +73,6 @@ use log::{error, info, warn}; #[cfg(feature = "native-tls")] use openssl_sys as _; // required for vendored-openssl feature -use openssl_sys as _; use options::LYCHEE_CONFIG_FILE; use ring as _; // required for apple silicon diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index a7447e1..3881dfb 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -41,7 +41,7 @@ pulldown-cmark = "0.9.3" regex = "1.9.1" # Use trust-dns to avoid lookup failures on high concurrency # https://github.com/seanmonstar/reqwest/issues/296 -reqwest = { version = "0.11.18", features = ["gzip", "trust-dns", "cookies"] } +reqwest = { version = "0.11.18", default-features = false, features = ["gzip", "trust-dns", "cookies"] } reqwest_cookie_store = "0.6.0" # Make build work on Apple Silicon. # See https://github.com/briansmith/ring/issues/1163 diff --git a/lychee-lib/src/client.rs b/lychee-lib/src/client.rs index 3bc1b04..6793f46 100644 --- a/lychee-lib/src/client.rs +++ b/lychee-lib/src/client.rs @@ -715,8 +715,12 @@ impl Client { } } + /// Check a mail address, or equivalently a `mailto` URI. + /// + /// This implementation simply excludes all email addresses. #[cfg(not(all(feature = "email-check", feature = "native-tls")))] - pub async fn check_mail(&self, uri: &Uri) -> Status { + #[allow(clippy::unused_async)] + pub async fn check_mail(&self, _uri: &Uri) -> Status { Status::Excluded } }