From 571d5bfcfba55ec86e4b2ee3545815f6d6d0e42b Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Tue, 29 Sep 2026 12:32:46 -0500 Subject: [PATCH] chore: Lint all cargo targets in CI --- .github/actions/ci/action.yml | 2 +- launchdarkly-server-sdk/Cargo.toml | 4 ++++ launchdarkly-server-sdk/src/client.rs | 4 +++- .../src/events/processor_builders.rs | 23 ++++++++++++++++++- launchdarkly-server-sdk/src/events/sender.rs | 2 +- 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index b8db4ef8..fb8afcfe 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -24,4 +24,4 @@ runs: - name: Run clippy checks shell: bash - run: cargo clippy ${{ inputs.cargo-flags }} -p launchdarkly-server-sdk -- -D warnings + run: cargo clippy ${{ inputs.cargo-flags }} --all-targets -p launchdarkly-server-sdk -- -D warnings diff --git a/launchdarkly-server-sdk/Cargo.toml b/launchdarkly-server-sdk/Cargo.toml index 807377c4..a0874760 100644 --- a/launchdarkly-server-sdk/Cargo.toml +++ b/launchdarkly-server-sdk/Cargo.toml @@ -104,6 +104,10 @@ float-roundtrip = [ "launchdarkly-server-sdk-evaluation/float-roundtrip" ] +[[example]] +name = "custom_transport" +required-features = ["hyper-rustls-native-roots"] + [[example]] name = "print_flags" required-features = ["hyper-rustls-native-roots"] diff --git a/launchdarkly-server-sdk/src/client.rs b/launchdarkly-server-sdk/src/client.rs index 03ceb3a5..4129b9ce 100644 --- a/launchdarkly-server-sdk/src/client.rs +++ b/launchdarkly-server-sdk/src/client.rs @@ -921,7 +921,9 @@ impl Client { mod tests { use assert_json_diff::assert_json_eq; use crossbeam_channel::Receiver; - use eval::{ContextBuilder, MultiContextBuilder}; + use eval::ContextBuilder; + #[cfg(any(feature = "crypto-aws-lc-rs", feature = "crypto-openssl"))] + use eval::MultiContextBuilder; use futures::FutureExt; use launchdarkly_server_sdk_evaluation::{Flag, Reason, Segment}; use maplit::hashmap; diff --git a/launchdarkly-server-sdk/src/events/processor_builders.rs b/launchdarkly-server-sdk/src/events/processor_builders.rs index 52494b20..ebb54034 100644 --- a/launchdarkly-server-sdk/src/events/processor_builders.rs +++ b/launchdarkly-server-sdk/src/events/processor_builders.rs @@ -339,11 +339,32 @@ impl Default for NullEventProcessorBuilder { #[cfg(test)] mod tests { - use launchdarkly_server_sdk_evaluation::ContextBuilder; use maplit::hashset; + + #[cfg(any( + feature = "hyper-rustls-native-roots", + feature = "hyper-rustls-webpki-roots", + feature = "native-tls" + ))] + use launchdarkly_server_sdk_evaluation::ContextBuilder; + #[cfg(any( + feature = "hyper-rustls-native-roots", + feature = "hyper-rustls-webpki-roots", + feature = "native-tls" + ))] use mockito::Matcher; + #[cfg(any( + feature = "hyper-rustls-native-roots", + feature = "hyper-rustls-webpki-roots", + feature = "native-tls" + ))] use test_case::test_case; + #[cfg(any( + feature = "hyper-rustls-native-roots", + feature = "hyper-rustls-webpki-roots", + feature = "native-tls" + ))] use crate::{events::event::EventFactory, ServiceEndpointsBuilder}; use super::*; diff --git a/launchdarkly-server-sdk/src/events/sender.rs b/launchdarkly-server-sdk/src/events/sender.rs index 162e84cb..fb12c0d9 100644 --- a/launchdarkly-server-sdk/src/events/sender.rs +++ b/launchdarkly-server-sdk/src/events/sender.rs @@ -353,7 +353,7 @@ mod tests { fn build_event_sender( url: String, ) -> HttpEventSender { - let url = format!("{}/bulk", &url); + let url = format!("{}/bulk", url); let url = http::Uri::from_str(&url).expect("Failed parsing the mock server url"); let transport = launchdarkly_sdk_transport::HyperTransport::new()