From 888307d23d852ebc2f453e788e7fd682efb9dd6f Mon Sep 17 00:00:00 2001 From: Julian Wiesler Date: Fri, 24 May 2024 16:53:55 +0200 Subject: [PATCH] fix: Leftover clippy warnings --- src/lib.rs | 4 ++-- src/resources/checkout_session_ext.rs | 2 +- src/resources/customer_ext.rs | 12 +++--------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0a7786516..5cecd5d30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,8 +52,8 @@ //! > Want to implement your own? If it is a common strategy, please consider opening a PR to add it to the library. //! Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. -#![allow(clippy::map_clone, clippy::large_enum_variant)] -#![warn(clippy::unwrap_used, clippy::missing_panics_doc)] +#![allow(clippy::large_enum_variant)] +#![warn(clippy::missing_panics_doc)] #![forbid(unsafe_code)] // Workaround #![allow(ambiguous_glob_reexports)] diff --git a/src/resources/checkout_session_ext.rs b/src/resources/checkout_session_ext.rs index 0e88d3853..4f7603212 100644 --- a/src/resources/checkout_session_ext.rs +++ b/src/resources/checkout_session_ext.rs @@ -55,6 +55,6 @@ impl CheckoutSession { id: &CheckoutSessionId, params: &RetrieveCheckoutSessionLineItems, ) -> Response> { - client.get_query(&format!("/checkout/sessions/{}/line_items", id), ¶ms) + client.get_query(&format!("/checkout/sessions/{}/line_items", id), params) } } diff --git a/src/resources/customer_ext.rs b/src/resources/customer_ext.rs index 299800521..4fa70af93 100644 --- a/src/resources/customer_ext.rs +++ b/src/resources/customer_ext.rs @@ -7,7 +7,7 @@ use crate::resources::{ BankAccount, Customer, PaymentMethod, PaymentSource, PaymentSourceParams, Source, }; -#[derive(Clone, Debug, Serialize, Eq, PartialEq)] +#[derive(Clone, Debug, Serialize, Default, Eq, PartialEq)] pub struct CustomerPaymentMethodRetrieval<'a> { /// A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. ///For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, @@ -37,13 +37,7 @@ pub struct CustomerPaymentMethodRetrieval<'a> { impl<'a> CustomerPaymentMethodRetrieval<'a> { pub fn new() -> Self { - CustomerPaymentMethodRetrieval { - ending_before: None, - expand: &[], - limit: None, - starting_after: None, - type_: None, - } + CustomerPaymentMethodRetrieval::default() } } @@ -83,7 +77,7 @@ pub struct CustomerSearchParams<'a> { impl<'a> CustomerSearchParams<'a> { pub fn new() -> CustomerSearchParams<'a> { - CustomerSearchParams { query: String::new(), limit: None, page: None, expand: &[] } + CustomerSearchParams::default() } }