Skip to content

Commit

Permalink
fix clippy (#1390)
Browse files Browse the repository at this point in the history
* fix clippy

* fix nit
  • Loading branch information
niklasad1 authored Jun 5, 2024
1 parent dc6a31b commit 236a561
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions client/http-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ pub type HttpResponse<T = HttpBody> = jsonrpsee_core::http_helpers::Response<T>;
pub type CustomCertStore = rustls::ClientConfig;

#[cfg(feature = "tls")]
// rustls needs the concrete `ClientConfig` type so we can't Box it here.
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
pub(crate) enum CertificateStore {
Native,
Expand Down
2 changes: 2 additions & 0 deletions client/transport/src/ws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ const LOG_TARGET: &str = "jsonrpsee-client";
pub type CustomCertStore = rustls::ClientConfig;

/// Certificate store to use for TLS connections.
// rustls needs the concrete `ClientConfig` type so we can't Box it here.
#[allow(clippy::large_enum_variant)]
#[cfg(feature = "tls")]
#[derive(Debug, Clone)]
pub enum CertificateStore {
Expand Down
8 changes: 3 additions & 5 deletions client/ws-client/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#![cfg(test)]

use crate::types::error::{ErrorCode, ErrorObject};
use crate::WsClientBuilder;

Expand Down Expand Up @@ -197,9 +195,9 @@ async fn batched_notifs_works() {
init_logger();

let notifs = vec![
serde_json::to_value(&Notification::new("test".into(), "method_notif".to_string())).unwrap(),
serde_json::to_value(&Notification::new("sub".into(), "method_notif".to_string())).unwrap(),
serde_json::to_value(&SubscriptionResponse::new(
serde_json::to_value(Notification::new("test".into(), "method_notif".to_string())).unwrap(),
serde_json::to_value(Notification::new("sub".into(), "method_notif".to_string())).unwrap(),
serde_json::to_value(SubscriptionResponse::new(
"sub".into(),
SubscriptionPayload {
subscription: SubscriptionId::Str("D3wwzU6vvoUUYehv4qoFzq42DZnLoAETeFzeyk8swH4o".into()),
Expand Down
2 changes: 1 addition & 1 deletion proc-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(crate) mod visitor;
/// implements the server trait into an `RpcModule`.
/// - For subscription methods:
/// - There will be one additional argument inserted right after `&self`: `subscription_sink: SubscriptionSink`.
/// It should be used to accept or reject a subscription and send data back to subscribers.
/// It should be used to accept or reject a subscription and send data back to the subscribers.
/// - The return type of the subscription method must implement `IntoSubscriptionCloseResponse`.
///
/// Since this macro can generate up to two traits, both server and client traits will have
Expand Down
3 changes: 0 additions & 3 deletions proc-macros/src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,7 @@ impl FindSubscriptionParams {
self.visit_type(elem);
}
}

syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}

#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
_ => {}
}
}
Expand Down

0 comments on commit 236a561

Please sign in to comment.