From cb4772f4107bbf35c08d02c054d3820070e4c11a Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 21 Jul 2023 11:06:37 +0200 Subject: [PATCH] Fix clippy 1.71 warnings --- .github/workflows/rust.yml | 2 +- src/api/search.rs | 15 --------------- src/lib.rs | 4 ++-- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 212246e4..740d31a2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,4 +22,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: cargo fmt --all -- --check - - run: cargo clippy --tests + - run: cargo clippy --tests --examples diff --git a/src/api/search.rs b/src/api/search.rs index cc3058b9..2df84a67 100644 --- a/src/api/search.rs +++ b/src/api/search.rs @@ -115,18 +115,6 @@ impl<'octo> SearchHandler<'octo> { } } -#[derive(Clone, Debug)] -pub enum ContentType { - TextMatch, - Default, -} - -impl Default for ContentType { - fn default() -> Self { - Self::Default - } -} - /// A handler for handling search queries to GitHub. #[derive(Clone, Debug, serde::Serialize)] pub struct QueryHandler<'octo, 'query, T> { @@ -136,8 +124,6 @@ pub struct QueryHandler<'octo, 'query, T> { crab: &'octo Octocrab, #[serde(skip)] route: &'static str, - #[serde(skip)] - content_type: ContentType, #[serde(rename = "q")] query: &'query str, per_page: Option, @@ -151,7 +137,6 @@ pub struct QueryHandler<'octo, 'query, T> { impl<'octo, 'query, T> QueryHandler<'octo, 'query, T> { pub(crate) fn new(crab: &'octo Octocrab, route: &'static str, query: &'query str) -> Self { Self { - content_type: ContentType::Default, crab, order: None, page: None, diff --git a/src/lib.rs b/src/lib.rs index 986d525f..b41a14a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -541,9 +541,9 @@ impl OctocrabBuilder #[cfg(all(feature = "rustls", not(feature = "opentls")))] let connector = { let builder = HttpsConnectorBuilder::new(); - #[cfg(all(feature = "rustls-webpki-tokio"))] + #[cfg(feature = "rustls-webpki-tokio")] let builder = builder.with_webpki_roots(); - #[cfg(all(not(feature = "rustls-webpki-tokio")))] + #[cfg(not(feature = "rustls-webpki-tokio"))] let builder = builder.with_native_roots(); // enabled the `rustls-native-certs` feature in hyper-rustls builder