diff --git a/.github/workflows/async-stripe.yml b/.github/workflows/async-stripe.yml index d520790df..25538d8d0 100644 --- a/.github/workflows/async-stripe.yml +++ b/.github/workflows/async-stripe.yml @@ -52,6 +52,8 @@ jobs: clippy: runs-on: ubuntu-20.04 + env: + RUSTFLAGS: -D warnings strategy: matrix: runtime: diff --git a/openapi/src/codegen.rs b/openapi/src/codegen.rs index 4b1f85ac1..97582ea42 100644 --- a/openapi/src/codegen.rs +++ b/openapi/src/codegen.rs @@ -1387,7 +1387,7 @@ pub fn gen_impl_requests( let query_path = segments.join("/"); writedoc!(&mut out, r#" pub fn list(client: &Client, params: &{params_name}<'_>) -> Response> {{ - client.get_query("/{query_path}", ¶ms) + client.get_query("/{query_path}", params) }} "#).unwrap(); methods.insert(MethodTypes::List, out); @@ -1414,7 +1414,7 @@ pub fn gen_impl_requests( out.push_str("> {\n"); out.push_str(" client.get_query("); out.push_str(&format!("&format!(\"/{}/{{}}\", id)", segments[0])); - out.push_str(", &Expand { expand })\n"); + out.push_str(", Expand { expand })\n"); } else { out.push_str(") -> Response<"); out.push_str(&rust_struct); @@ -1473,6 +1473,7 @@ pub fn gen_impl_requests( out.push_str("<'_>) -> Response<"); out.push_str(&return_type); out.push_str("> {\n"); + out.push_str(" #[allow(clippy::needless_borrows_for_generic_args)]\n"); out.push_str(" client.post_form(\"/"); out.push_str(&segments.join("/")); out.push_str("\", ¶ms)\n"); @@ -1513,6 +1514,7 @@ pub fn gen_impl_requests( out.push_str("<'_>) -> Response<"); out.push_str(&return_type); out.push_str("> {\n"); + out.push_str(" #[allow(clippy::needless_borrows_for_generic_args)]\n"); out.push_str(" client.post_form("); out.push_str(&format!("&format!(\"/{}/{{}}\", id)", segments[0])); out.push_str(", ¶ms)\n"); diff --git a/src/client/base/async_std.rs b/src/client/base/async_std.rs index 7cbec65ac..5215afa22 100644 --- a/src/client/base/async_std.rs +++ b/src/client/base/async_std.rs @@ -27,6 +27,12 @@ pub struct AsyncStdClient { client: surf::Client, } +impl Default for AsyncStdClient { + fn default() -> Self { + Self::new() + } +} + impl AsyncStdClient { /// Creates a new client pointed to `https://api.stripe.com/` pub fn new() -> Self { diff --git a/src/client/base/tokio_blocking.rs b/src/client/base/tokio_blocking.rs index 8192eeabf..6fbd0c989 100644 --- a/src/client/base/tokio_blocking.rs +++ b/src/client/base/tokio_blocking.rs @@ -28,6 +28,12 @@ pub struct TokioBlockingClient { runtime: Arc, } +impl Default for TokioBlockingClient { + fn default() -> Self { + Self::new() + } +} + impl TokioBlockingClient { /// Creates a new client pointed to `https://api.stripe.com/` pub fn new() -> TokioBlockingClient { diff --git a/src/client/stripe.rs b/src/client/stripe.rs index d3b0aa23d..1f55edee9 100644 --- a/src/client/stripe.rs +++ b/src/client/stripe.rs @@ -29,6 +29,9 @@ impl Client { } /// Create a new account pointed at a specific URL. This is useful for testing. + /// + /// # Panics + /// If the url can't be parsed pub fn from_url<'a>(url: impl Into<&'a str>, secret_key: impl Into) -> Self { Client { client: BaseClient::new(), @@ -76,7 +79,7 @@ impl Client { url: Option, ) -> Self { let app_info = AppInfo { name, version, url }; - self.headers.user_agent = format!("{} {}", USER_AGENT, app_info.to_string()); + self.headers.user_agent = format!("{} {}", USER_AGENT, app_info); self.app_info = Some(app_info); self } @@ -126,6 +129,9 @@ impl Client { } /// Make a `POST` http request with urlencoded body + /// + /// # Panics + /// If the form is not serialized to an utf8 string. pub fn post_form( &self, path: &str, diff --git a/src/lib.rs b/src/lib.rs index fa705d4a5..0a7786516 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,7 +53,7 @@ //! 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_errors_doc, clippy::missing_panics_doc)] +#![warn(clippy::unwrap_used, clippy::missing_panics_doc)] #![forbid(unsafe_code)] // Workaround #![allow(ambiguous_glob_reexports)] diff --git a/src/params.rs b/src/params.rs index 224cd6e23..f1709e29d 100644 --- a/src/params.rs +++ b/src/params.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::fmt::Display; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; @@ -20,16 +21,16 @@ pub struct AppInfo { pub version: Option, } -impl ToString for AppInfo { - /// Formats a plugin's 'App Info' into a string that can be added to the end of an User-Agent string. +impl Display for AppInfo { + /// Formats a plugin's 'App Info' that can be added to the end of a User-Agent string. /// /// This formatting matches that of other libraries, and if changed then it should be changed everywhere. - fn to_string(&self) -> String { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match (&self.version, &self.url) { - (Some(a), Some(b)) => format!("{}/{} ({})", &self.name, a, b), - (Some(a), None) => format!("{}/{}", &self.name, a), - (None, Some(b)) => format!("{} ({})", &self.name, b), - _ => self.name.to_string(), + (Some(a), Some(b)) => write!(f, "{}/{} ({})", &self.name, a, b), + (Some(a), None) => write!(f, "{}/{}", &self.name, a), + (None, Some(b)) => write!(f, "{} ({})", &self.name, b), + _ => write!(f, "{}", self.name), } } } @@ -327,11 +328,11 @@ where let mut paginator = self; loop { if !paginator.page.has_more() { - data.extend(paginator.page.get_data_mut().drain(..)); + data.append(paginator.page.get_data_mut()); break; } let next_paginator = paginator.next(client)?; - data.extend(paginator.page.get_data_mut().drain(..)); + data.append(paginator.page.get_data_mut()); paginator = next_paginator } Ok(data) diff --git a/src/resources.rs b/src/resources.rs index a25a318ad..a2189ea0d 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -7,8 +7,9 @@ //! some are generated. mod currency; +#[allow(clippy::module_inception)] +#[allow(clippy::new_without_default)] pub mod generated; -mod placeholders; mod types; #[path = "resources"] diff --git a/src/resources/checkout_session_ext.rs b/src/resources/checkout_session_ext.rs index 9d6d00e78..4cde2cf2f 100644 --- a/src/resources/checkout_session_ext.rs +++ b/src/resources/checkout_session_ext.rs @@ -12,7 +12,7 @@ impl CheckoutSession { id: &CheckoutSessionId, expand: &[&str], ) -> Response { - client.get_query(&format!("/checkout/sessions/{}", id), &Expand { expand }) + client.get_query(&format!("/checkout/sessions/{}", id), Expand { expand }) } /// Expires a checkout session. diff --git a/src/resources/customer_balance_transaction_ext.rs b/src/resources/customer_balance_transaction_ext.rs index 0b5a4875a..913077ad6 100644 --- a/src/resources/customer_balance_transaction_ext.rs +++ b/src/resources/customer_balance_transaction_ext.rs @@ -97,6 +97,7 @@ impl Customer { customer_id: &CustomerId, params: ListCustomerBalanceTransactions<'_>, ) -> Response> { + #[allow(clippy::needless_borrows_for_generic_args)] client.get_query(&format!("/customers/{}/balance_transactions", customer_id), ¶ms) } @@ -106,6 +107,7 @@ impl Customer { customer_id: &CustomerId, params: CreateCustomerBalanceTransaction<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/customers/{}/balance_transactions", customer_id), ¶ms) } @@ -118,7 +120,7 @@ impl Customer { ) -> Response { client.get_query( &format!("/customers/{}/balance_transactions/{}", customer_id, id), - &Expand { expand }, + Expand { expand }, ) } @@ -131,6 +133,7 @@ impl Customer { id: &CustomerBalanceTransactionId, params: UpdateCustomerBalanceTransaction<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client .post_form(&format!("/customers/{}/balance_transactions/{}", customer_id, id), ¶ms) } diff --git a/src/resources/customer_ext.rs b/src/resources/customer_ext.rs index 5e1b03215..3e66f3f19 100644 --- a/src/resources/customer_ext.rs +++ b/src/resources/customer_ext.rs @@ -146,6 +146,7 @@ impl Customer { customer_id: &CustomerId, params: CustomerPaymentMethodRetrieval<'_>, ) -> Response> { + #[allow(clippy::needless_borrows_for_generic_args)] client.get_query(&format!("/customers/{}/payment_methods", customer_id), ¶ms) } diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs index 54178eda9..bb3a6bb5b 100644 --- a/src/resources/generated/account.rs +++ b/src/resources/generated/account.rs @@ -122,7 +122,7 @@ impl Account { /// /// If you’re not a platform, the list is empty. pub fn list(client: &Client, params: &ListAccounts<'_>) -> Response> { - client.get_query("/accounts", ¶ms) + client.get_query("/accounts", params) } /// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. @@ -133,12 +133,13 @@ impl Account { /// /// Connect Onboarding won’t ask for the prefilled information during account onboarding. You can prefill any information on the account. pub fn create(client: &Client, params: CreateAccount<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/accounts", ¶ms) } /// Retrieves the details of an account. pub fn retrieve(client: &Client, id: &AccountId, expand: &[&str]) -> Response { - client.get_query(&format!("/accounts/{}", id), &Expand { expand }) + client.get_query(&format!("/accounts/{}", id), Expand { expand }) } /// Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. @@ -148,6 +149,7 @@ impl Account { /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), some properties can only be changed or updated for Custom accounts. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). /// Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. pub fn update(client: &Client, id: &AccountId, params: UpdateAccount<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/accounts/{}", id), ¶ms) } diff --git a/src/resources/generated/account_link.rs b/src/resources/generated/account_link.rs index 487d6b4bb..b3c2c91f6 100644 --- a/src/resources/generated/account_link.rs +++ b/src/resources/generated/account_link.rs @@ -28,6 +28,7 @@ pub struct AccountLink { impl AccountLink { /// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. pub fn create(client: &Client, params: CreateAccountLink<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/account_links", ¶ms) } } diff --git a/src/resources/generated/account_session.rs b/src/resources/generated/account_session.rs index f80d3ed9c..ec2521b5d 100644 --- a/src/resources/generated/account_session.rs +++ b/src/resources/generated/account_session.rs @@ -36,6 +36,7 @@ impl AccountSession { /// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. pub fn create(client: &Client, params: CreateAccountSession<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/account_sessions", ¶ms) } } diff --git a/src/resources/generated/application_fee.rs b/src/resources/generated/application_fee.rs index 507ba112d..08954d596 100644 --- a/src/resources/generated/application_fee.rs +++ b/src/resources/generated/application_fee.rs @@ -70,7 +70,7 @@ impl ApplicationFee { client: &Client, params: &ListApplicationFees<'_>, ) -> Response> { - client.get_query("/application_fees", ¶ms) + client.get_query("/application_fees", params) } /// Retrieves the details of an application fee that your account has collected. @@ -81,7 +81,7 @@ impl ApplicationFee { id: &ApplicationFeeId, expand: &[&str], ) -> Response { - client.get_query(&format!("/application_fees/{}", id), &Expand { expand }) + client.get_query(&format!("/application_fees/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/balance_transaction.rs b/src/resources/generated/balance_transaction.rs index 17b9c5274..629dbe1d5 100644 --- a/src/resources/generated/balance_transaction.rs +++ b/src/resources/generated/balance_transaction.rs @@ -88,7 +88,7 @@ impl BalanceTransaction { client: &Client, params: &ListBalanceTransactions<'_>, ) -> Response> { - client.get_query("/balance_transactions", ¶ms) + client.get_query("/balance_transactions", params) } /// Retrieves the balance transaction with the given ID. @@ -99,7 +99,7 @@ impl BalanceTransaction { id: &BalanceTransactionId, expand: &[&str], ) -> Response { - client.get_query(&format!("/balance_transactions/{}", id), &Expand { expand }) + client.get_query(&format!("/balance_transactions/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/billing_portal_session.rs b/src/resources/generated/billing_portal_session.rs index f8cc2e323..70ea41ebe 100644 --- a/src/resources/generated/billing_portal_session.rs +++ b/src/resources/generated/billing_portal_session.rs @@ -59,6 +59,7 @@ impl BillingPortalSession { client: &Client, params: CreateBillingPortalSession<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/billing_portal/sessions", ¶ms) } } diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index 2a627f6d2..6ec262e75 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -213,7 +213,7 @@ impl Charge { /// /// The charges are returned in sorted order, with the most recent charges appearing first. pub fn list(client: &Client, params: &ListCharges<'_>) -> Response> { - client.get_query("/charges", ¶ms) + client.get_query("/charges", params) } /// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) @@ -221,6 +221,7 @@ impl Charge { /// /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment. pub fn create(client: &Client, params: CreateCharge<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/charges", ¶ms) } @@ -229,13 +230,14 @@ impl Charge { /// Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. /// The same information is returned when creating or refunding the charge. pub fn retrieve(client: &Client, id: &ChargeId, expand: &[&str]) -> Response { - client.get_query(&format!("/charges/{}", id), &Expand { expand }) + client.get_query(&format!("/charges/{}", id), Expand { expand }) } /// Updates the specified charge by setting the values of the parameters passed. /// /// Any parameters not provided will be left unchanged. pub fn update(client: &Client, id: &ChargeId, params: UpdateCharge<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/charges/{}", id), ¶ms) } } diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index b0988c132..30545ffda 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -235,11 +235,12 @@ impl CheckoutSession { client: &Client, params: &ListCheckoutSessions<'_>, ) -> Response> { - client.get_query("/checkout/sessions", ¶ms) + client.get_query("/checkout/sessions", params) } /// Creates a Session object. pub fn create(client: &Client, params: CreateCheckoutSession<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/checkout/sessions", ¶ms) } } diff --git a/src/resources/generated/country_spec.rs b/src/resources/generated/country_spec.rs index 2392888f0..cad17ec40 100644 --- a/src/resources/generated/country_spec.rs +++ b/src/resources/generated/country_spec.rs @@ -45,13 +45,13 @@ impl CountrySpec { /// Lists all Country Spec objects available in the API. pub fn list(client: &Client, params: &ListCountrySpecs<'_>) -> Response> { - client.get_query("/country_specs", ¶ms) + client.get_query("/country_specs", params) } /// Returns a Country Spec for a given Country code. pub fn retrieve(client: &Client, id: &CountrySpecId, expand: &[&str]) -> Response { - client.get_query(&format!("/country_specs/{}", id), &Expand { expand }) + client.get_query(&format!("/country_specs/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/coupon.rs b/src/resources/generated/coupon.rs index b32bb4f38..1c1a6c8d6 100644 --- a/src/resources/generated/coupon.rs +++ b/src/resources/generated/coupon.rs @@ -98,7 +98,7 @@ pub struct Coupon { impl Coupon { /// Returns a list of your coupons. pub fn list(client: &Client, params: &ListCoupons<'_>) -> Response> { - client.get_query("/coupons", ¶ms) + client.get_query("/coupons", params) } /// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. @@ -107,18 +107,20 @@ impl Coupon { /// If you set an `amount_off`, that amount will be subtracted from any invoice’s subtotal. /// For example, an invoice with a subtotal of $100 will have a final total of $0 if a coupon with an `amount_off` of 20000 is applied to it and an invoice with a subtotal of $300 will have a final total of $100 if a coupon with an `amount_off` of 20000 is applied to it. pub fn create(client: &Client, params: CreateCoupon<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/coupons", ¶ms) } /// Retrieves the coupon with the given ID. pub fn retrieve(client: &Client, id: &CouponId, expand: &[&str]) -> Response { - client.get_query(&format!("/coupons/{}", id), &Expand { expand }) + client.get_query(&format!("/coupons/{}", id), Expand { expand }) } /// Updates the metadata of a coupon. /// /// Other coupon details (currency, duration, amount_off) are, by design, not editable. pub fn update(client: &Client, id: &CouponId, params: UpdateCoupon<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/coupons/{}", id), ¶ms) } diff --git a/src/resources/generated/credit_note.rs b/src/resources/generated/credit_note.rs index 2d3847d8a..d59172bbe 100644 --- a/src/resources/generated/credit_note.rs +++ b/src/resources/generated/credit_note.rs @@ -123,7 +123,7 @@ pub struct CreditNote { impl CreditNote { /// Returns a list of credit notes. pub fn list(client: &Client, params: &ListCreditNotes<'_>) -> Response> { - client.get_query("/credit_notes", ¶ms) + client.get_query("/credit_notes", params) } /// Issue a credit note to adjust the amount of a finalized invoice. @@ -133,12 +133,13 @@ impl CreditNote { /// Instead, it can result in any combination of the following:
  • Refund: create a new refund (using `refund_amount`) or link an existing refund (using `refund`).
  • Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized.
  • Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`).
For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. /// Each credit note will increment the invoice’s `pre_payment_credit_notes_amount` or `post_payment_credit_notes_amount` depending on its `status` at the time of credit note creation. pub fn create(client: &Client, params: CreateCreditNote<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/credit_notes", ¶ms) } /// Retrieves the credit note object with the given identifier. pub fn retrieve(client: &Client, id: &CreditNoteId, expand: &[&str]) -> Response { - client.get_query(&format!("/credit_notes/{}", id), &Expand { expand }) + client.get_query(&format!("/credit_notes/{}", id), Expand { expand }) } /// Updates an existing credit note. @@ -147,6 +148,7 @@ impl CreditNote { id: &CreditNoteId, params: UpdateCreditNote<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/credit_notes/{}", id), ¶ms) } } diff --git a/src/resources/generated/customer.rs b/src/resources/generated/customer.rs index 74290612c..eae9fe5b6 100644 --- a/src/resources/generated/customer.rs +++ b/src/resources/generated/customer.rs @@ -165,17 +165,18 @@ impl Customer { /// /// The customers are returned sorted by creation date, with the most recent customers appearing first. pub fn list(client: &Client, params: &ListCustomers<'_>) -> Response> { - client.get_query("/customers", ¶ms) + client.get_query("/customers", params) } /// Creates a new customer object. pub fn create(client: &Client, params: CreateCustomer<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/customers", ¶ms) } /// Retrieves a Customer object. pub fn retrieve(client: &Client, id: &CustomerId, expand: &[&str]) -> Response { - client.get_query(&format!("/customers/{}", id), &Expand { expand }) + client.get_query(&format!("/customers/{}", id), Expand { expand }) } /// Updates the specified customer by setting the values of the parameters passed. @@ -190,6 +191,7 @@ impl Customer { id: &CustomerId, params: UpdateCustomer<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/customers/{}", id), ¶ms) } diff --git a/src/resources/generated/customer_session.rs b/src/resources/generated/customer_session.rs index 13bd934d7..5a8981edf 100644 --- a/src/resources/generated/customer_session.rs +++ b/src/resources/generated/customer_session.rs @@ -43,6 +43,7 @@ impl CustomerSession { /// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. pub fn create(client: &Client, params: CreateCustomerSession<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/customer_sessions", ¶ms) } } diff --git a/src/resources/generated/dispute.rs b/src/resources/generated/dispute.rs index 129291a98..d150d9f06 100644 --- a/src/resources/generated/dispute.rs +++ b/src/resources/generated/dispute.rs @@ -80,12 +80,12 @@ pub struct Dispute { impl Dispute { /// Returns a list of your disputes. pub fn list(client: &Client, params: &ListDisputes<'_>) -> Response> { - client.get_query("/disputes", ¶ms) + client.get_query("/disputes", params) } /// Retrieves the dispute with the given ID. pub fn retrieve(client: &Client, id: &DisputeId, expand: &[&str]) -> Response { - client.get_query(&format!("/disputes/{}", id), &Expand { expand }) + client.get_query(&format!("/disputes/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/ephemeral_key.rs b/src/resources/generated/ephemeral_key.rs index a9ee6c0fc..d87fd7eff 100644 --- a/src/resources/generated/ephemeral_key.rs +++ b/src/resources/generated/ephemeral_key.rs @@ -37,6 +37,7 @@ pub struct EphemeralKey { impl EphemeralKey { /// Creates a short-lived API key for a given resource. pub fn create(client: &Client, params: CreateEphemeralKey<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/ephemeral_keys", ¶ms) } diff --git a/src/resources/generated/event.rs b/src/resources/generated/event.rs index a3a85e112..8bfb0c8a1 100644 --- a/src/resources/generated/event.rs +++ b/src/resources/generated/event.rs @@ -52,14 +52,14 @@ impl Event { /// /// Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) `api_version` attribute (not according to your current Stripe API version or `Stripe-Version` header). pub fn list(client: &Client, params: &ListEvents<'_>) -> Response> { - client.get_query("/events", ¶ms) + client.get_query("/events", params) } /// Retrieves the details of an event. /// /// Supply the unique identifier of the event, which you might have received in a webhook. pub fn retrieve(client: &Client, id: &EventId, expand: &[&str]) -> Response { - client.get_query(&format!("/events/{}", id), &Expand { expand }) + client.get_query(&format!("/events/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/exchange_rate.rs b/src/resources/generated/exchange_rate.rs index 52f13cf58..3557c2211 100644 --- a/src/resources/generated/exchange_rate.rs +++ b/src/resources/generated/exchange_rate.rs @@ -25,13 +25,13 @@ impl ExchangeRate { /// /// Only shows the currencies for which Stripe supports. pub fn list(client: &Client, params: &ListExchangeRates<'_>) -> Response> { - client.get_query("/exchange_rates", ¶ms) + client.get_query("/exchange_rates", params) } /// Retrieves the exchange rates from the given currency to every supported currency. pub fn retrieve(client: &Client, id: &ExchangeRateId, expand: &[&str]) -> Response { - client.get_query(&format!("/exchange_rates/{}", id), &Expand { expand }) + client.get_query(&format!("/exchange_rates/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/file.rs b/src/resources/generated/file.rs index e88126ffd..24bfa30a6 100644 --- a/src/resources/generated/file.rs +++ b/src/resources/generated/file.rs @@ -54,7 +54,7 @@ impl File { /// /// Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. pub fn list(client: &Client, params: &ListFiles<'_>) -> Response> { - client.get_query("/files", ¶ms) + client.get_query("/files", params) } /// Retrieves the details of an existing file object. @@ -62,7 +62,7 @@ impl File { /// After you supply a unique file ID, Stripe returns the corresponding file object. /// Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). pub fn retrieve(client: &Client, id: &FileId, expand: &[&str]) -> Response { - client.get_query(&format!("/files/{}", id), &Expand { expand }) + client.get_query(&format!("/files/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/file_link.rs b/src/resources/generated/file_link.rs index 7b30826cc..fad3a59a7 100644 --- a/src/resources/generated/file_link.rs +++ b/src/resources/generated/file_link.rs @@ -46,17 +46,18 @@ pub struct FileLink { impl FileLink { /// Returns a list of file links. pub fn list(client: &Client, params: &ListFileLinks<'_>) -> Response> { - client.get_query("/file_links", ¶ms) + client.get_query("/file_links", params) } /// Creates a new file link object. pub fn create(client: &Client, params: CreateFileLink<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/file_links", ¶ms) } /// Retrieves the file link with the given ID. pub fn retrieve(client: &Client, id: &FileLinkId, expand: &[&str]) -> Response { - client.get_query(&format!("/file_links/{}", id), &Expand { expand }) + client.get_query(&format!("/file_links/{}", id), Expand { expand }) } /// Updates an existing file link object. @@ -67,6 +68,7 @@ impl FileLink { id: &FileLinkId, params: UpdateFileLink<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/file_links/{}", id), ¶ms) } } diff --git a/src/resources/generated/financial_connections_session.rs b/src/resources/generated/financial_connections_session.rs index 85036b049..17e2358d8 100644 --- a/src/resources/generated/financial_connections_session.rs +++ b/src/resources/generated/financial_connections_session.rs @@ -50,6 +50,7 @@ impl FinancialConnectionsSession { /// /// The session’s `client_secret` can be used to launch the flow using Stripe.js. pub fn create(client: &Client, params: CreateFinancialConnectionsSession<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/financial_connections/sessions", ¶ms) } } diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs index 267496ac8..5128f0c91 100644 --- a/src/resources/generated/invoice.rs +++ b/src/resources/generated/invoice.rs @@ -473,19 +473,20 @@ impl Invoice { /// /// The invoices are returned sorted by creation date, with the most recently created invoices appearing first. pub fn list(client: &Client, params: &ListInvoices<'_>) -> Response> { - client.get_query("/invoices", ¶ms) + client.get_query("/invoices", params) } /// This endpoint creates a draft invoice for a given customer. /// /// The invoice remains a draft until you [finalize](https://stripe.com/docs/api#finalize_invoice) the invoice, which allows you to [pay](https://stripe.com/docs/api#pay_invoice) or [send](https://stripe.com/docs/api#send_invoice) the invoice to your customers. pub fn create(client: &Client, params: CreateInvoice<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/invoices", ¶ms) } /// Retrieves the invoice with the given ID. pub fn retrieve(client: &Client, id: &InvoiceId, expand: &[&str]) -> Response { - client.get_query(&format!("/invoices/{}", id), &Expand { expand }) + client.get_query(&format!("/invoices/{}", id), Expand { expand }) } /// Permanently deletes a one-off invoice draft. diff --git a/src/resources/generated/invoiceitem.rs b/src/resources/generated/invoiceitem.rs index bc114979d..c48a5705d 100644 --- a/src/resources/generated/invoiceitem.rs +++ b/src/resources/generated/invoiceitem.rs @@ -134,19 +134,20 @@ impl InvoiceItem { /// /// Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. pub fn list(client: &Client, params: &ListInvoiceItems<'_>) -> Response> { - client.get_query("/invoiceitems", ¶ms) + client.get_query("/invoiceitems", params) } /// Creates an item to be added to a draft invoice (up to 250 items per invoice). /// /// If no invoice is specified, the item will be on the next invoice created for the customer specified. pub fn create(client: &Client, params: CreateInvoiceItem<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/invoiceitems", ¶ms) } /// Retrieves the invoice item with the given ID. pub fn retrieve(client: &Client, id: &InvoiceItemId, expand: &[&str]) -> Response { - client.get_query(&format!("/invoiceitems/{}", id), &Expand { expand }) + client.get_query(&format!("/invoiceitems/{}", id), Expand { expand }) } /// Updates the amount or description of an invoice item on an upcoming invoice. @@ -157,6 +158,7 @@ impl InvoiceItem { id: &InvoiceItemId, params: UpdateInvoiceItem<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/invoiceitems/{}", id), ¶ms) } diff --git a/src/resources/generated/mandate.rs b/src/resources/generated/mandate.rs index ec4a08129..845268a65 100644 --- a/src/resources/generated/mandate.rs +++ b/src/resources/generated/mandate.rs @@ -48,7 +48,7 @@ pub struct Mandate { impl Mandate { /// Retrieves a Mandate object. pub fn retrieve(client: &Client, id: &MandateId, expand: &[&str]) -> Response { - client.get_query(&format!("/mandates/{}", id), &Expand { expand }) + client.get_query(&format!("/mandates/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index ea7a6c25c..1a7baa496 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -198,7 +198,7 @@ pub struct PaymentIntent { impl PaymentIntent { /// Returns a list of PaymentIntents. pub fn list(client: &Client, params: &ListPaymentIntents<'_>) -> Response> { - client.get_query("/payment_intents", ¶ms) + client.get_query("/payment_intents", params) } /// Creates a PaymentIntent object. @@ -209,6 +209,7 @@ impl PaymentIntent { /// Learn more about [the available payment flows with the Payment Intents API](https://stripe.com/docs/payments/payment-intents). When you use `confirm=true` during creation, it’s equivalent to creating and confirming the PaymentIntent in the same call. /// You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply `confirm=true`. pub fn create(client: &Client, params: CreatePaymentIntent<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/payment_intents", ¶ms) } @@ -222,7 +223,7 @@ impl PaymentIntent { id: &PaymentIntentId, expand: &[&str], ) -> Response { - client.get_query(&format!("/payment_intents/{}", id), &Expand { expand }) + client.get_query(&format!("/payment_intents/{}", id), Expand { expand }) } /// Updates properties on a PaymentIntent object without confirming. @@ -237,6 +238,7 @@ impl PaymentIntent { id: &PaymentIntentId, params: UpdatePaymentIntent<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/payment_intents/{}", id), ¶ms) } } diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index ff4b26102..01a778d58 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -127,17 +127,18 @@ pub struct PaymentLink { impl PaymentLink { /// Returns a list of your payment links. pub fn list(client: &Client, params: &ListPaymentLinks<'_>) -> Response> { - client.get_query("/payment_links", ¶ms) + client.get_query("/payment_links", params) } /// Creates a payment link. pub fn create(client: &Client, params: CreatePaymentLink<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/payment_links", ¶ms) } /// Retrieve a payment link. pub fn retrieve(client: &Client, id: &PaymentLinkId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_links/{}", id), &Expand { expand }) + client.get_query(&format!("/payment_links/{}", id), Expand { expand }) } /// Updates a payment link. @@ -146,6 +147,7 @@ impl PaymentLink { id: &PaymentLinkId, params: UpdatePaymentLink<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/payment_links/{}", id), ¶ms) } } diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs index 3a23dc401..88e7c5060 100644 --- a/src/resources/generated/payment_method.rs +++ b/src/resources/generated/payment_method.rs @@ -161,13 +161,14 @@ impl PaymentMethod { /// /// If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. pub fn list(client: &Client, params: &ListPaymentMethods<'_>) -> Response> { - client.get_query("/payment_methods", ¶ms) + client.get_query("/payment_methods", params) } /// Creates a PaymentMethod object. /// /// Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents](https://stripe.com/docs/payments/accept-a-payment) API to accept a payment immediately or the [SetupIntent](https://stripe.com/docs/payments/save-and-reuse) API to collect payment method details ahead of a future payment. pub fn create(client: &Client, params: CreatePaymentMethod<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/payment_methods", ¶ms) } @@ -179,7 +180,7 @@ impl PaymentMethod { id: &PaymentMethodId, expand: &[&str], ) -> Response { - client.get_query(&format!("/payment_methods/{}", id), &Expand { expand }) + client.get_query(&format!("/payment_methods/{}", id), Expand { expand }) } /// Updates a PaymentMethod object. @@ -190,6 +191,7 @@ impl PaymentMethod { id: &PaymentMethodId, params: UpdatePaymentMethod<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/payment_methods/{}", id), ¶ms) } } diff --git a/src/resources/generated/payment_method_configuration.rs b/src/resources/generated/payment_method_configuration.rs index 71fd1b576..edf42eed0 100644 --- a/src/resources/generated/payment_method_configuration.rs +++ b/src/resources/generated/payment_method_configuration.rs @@ -140,22 +140,24 @@ impl PaymentMethodConfiguration { /// List payment method configurations. pub fn list(client: &Client, params: &ListPaymentMethodConfigurations<'_>) -> Response> { - client.get_query("/payment_method_configurations", ¶ms) + client.get_query("/payment_method_configurations", params) } /// Creates a payment method configuration. pub fn create(client: &Client, params: CreatePaymentMethodConfiguration<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/payment_method_configurations", ¶ms) } /// Retrieve payment method configuration. pub fn retrieve(client: &Client, id: &PaymentMethodConfigurationId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_method_configurations/{}", id), &Expand { expand }) + client.get_query(&format!("/payment_method_configurations/{}", id), Expand { expand }) } /// Update payment method configuration. pub fn update(client: &Client, id: &PaymentMethodConfigurationId, params: UpdatePaymentMethodConfiguration<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/payment_method_configurations/{}", id), ¶ms) } } diff --git a/src/resources/generated/payment_method_domain.rs b/src/resources/generated/payment_method_domain.rs index 714568537..9aa5b19d8 100644 --- a/src/resources/generated/payment_method_domain.rs +++ b/src/resources/generated/payment_method_domain.rs @@ -44,22 +44,24 @@ impl PaymentMethodDomain { /// Lists the details of existing payment method domains. pub fn list(client: &Client, params: &ListPaymentMethodDomains<'_>) -> Response> { - client.get_query("/payment_method_domains", ¶ms) + client.get_query("/payment_method_domains", params) } /// Creates a payment method domain. pub fn create(client: &Client, params: CreatePaymentMethodDomain<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/payment_method_domains", ¶ms) } /// Retrieves the details of an existing payment method domain. pub fn retrieve(client: &Client, id: &PaymentMethodDomainId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_method_domains/{}", id), &Expand { expand }) + client.get_query(&format!("/payment_method_domains/{}", id), Expand { expand }) } /// Updates an existing payment method domain. pub fn update(client: &Client, id: &PaymentMethodDomainId, params: UpdatePaymentMethodDomain<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/payment_method_domains/{}", id), ¶ms) } } diff --git a/src/resources/generated/payout.rs b/src/resources/generated/payout.rs index c4739e516..a1da275c9 100644 --- a/src/resources/generated/payout.rs +++ b/src/resources/generated/payout.rs @@ -106,7 +106,7 @@ impl Payout { /// /// The payouts return in sorted order, with the most recently created payouts appearing first. pub fn list(client: &Client, params: &ListPayouts<'_>) -> Response> { - client.get_query("/payouts", ¶ms) + client.get_query("/payouts", params) } /// To send funds to your own bank account, create a new payout object. @@ -115,6 +115,7 @@ impl Payout { /// If it doesn’t, you receive an “Insufficient Funds” error. If your API key is in test mode, money won’t actually be sent, though every other action occurs as if you’re in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. /// The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. pub fn create(client: &Client, params: CreatePayout<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/payouts", ¶ms) } @@ -123,7 +124,7 @@ impl Payout { /// Supply the unique payout ID from either a payout creation request or the payout list. /// Stripe returns the corresponding payout information. pub fn retrieve(client: &Client, id: &PayoutId, expand: &[&str]) -> Response { - client.get_query(&format!("/payouts/{}", id), &Expand { expand }) + client.get_query(&format!("/payouts/{}", id), Expand { expand }) } /// Updates the specified payout by setting the values of the parameters you pass. @@ -131,6 +132,7 @@ impl Payout { /// We don’t change parameters that you don’t provide. /// This request only accepts the metadata as arguments. pub fn update(client: &Client, id: &PayoutId, params: UpdatePayout<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/payouts/{}", id), ¶ms) } } diff --git a/src/resources/generated/plan.rs b/src/resources/generated/plan.rs index 495df6630..ac57f6243 100644 --- a/src/resources/generated/plan.rs +++ b/src/resources/generated/plan.rs @@ -134,12 +134,12 @@ pub struct Plan { impl Plan { /// Returns a list of your plans. pub fn list(client: &Client, params: &ListPlans<'_>) -> Response> { - client.get_query("/plans", ¶ms) + client.get_query("/plans", params) } /// Retrieves the plan with the given ID. pub fn retrieve(client: &Client, id: &PlanId, expand: &[&str]) -> Response { - client.get_query(&format!("/plans/{}", id), &Expand { expand }) + client.get_query(&format!("/plans/{}", id), Expand { expand }) } /// Updates the specified plan by setting the values of the parameters passed. @@ -147,6 +147,7 @@ impl Plan { /// Any parameters not provided are left unchanged. /// By design, you cannot change a plan’s ID, amount, currency, or billing cycle. pub fn update(client: &Client, id: &PlanId, params: UpdatePlan<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/plans/{}", id), ¶ms) } diff --git a/src/resources/generated/price.rs b/src/resources/generated/price.rs index eef046fe2..9e58d97f6 100644 --- a/src/resources/generated/price.rs +++ b/src/resources/generated/price.rs @@ -137,25 +137,27 @@ impl Price { /// /// For the list of inactive prices, set `active` to false. pub fn list(client: &Client, params: &ListPrices<'_>) -> Response> { - client.get_query("/prices", ¶ms) + client.get_query("/prices", params) } /// Creates a new price for an existing product. /// /// The price can be recurring or one-time. pub fn create(client: &Client, params: CreatePrice<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/prices", ¶ms) } /// Retrieves the price with the given ID. pub fn retrieve(client: &Client, id: &PriceId, expand: &[&str]) -> Response { - client.get_query(&format!("/prices/{}", id), &Expand { expand }) + client.get_query(&format!("/prices/{}", id), Expand { expand }) } /// Updates the specified price by setting the values of the parameters passed. /// /// Any parameters not provided are left unchanged. pub fn update(client: &Client, id: &PriceId, params: UpdatePrice<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/prices/{}", id), ¶ms) } } diff --git a/src/resources/generated/product.rs b/src/resources/generated/product.rs index 49a6f6e14..3ed50337d 100644 --- a/src/resources/generated/product.rs +++ b/src/resources/generated/product.rs @@ -115,11 +115,12 @@ impl Product { /// /// The products are returned sorted by creation date, with the most recently created products appearing first. pub fn list(client: &Client, params: &ListProducts<'_>) -> Response> { - client.get_query("/products", ¶ms) + client.get_query("/products", params) } /// Creates a new product object. pub fn create(client: &Client, params: CreateProduct<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/products", ¶ms) } @@ -127,13 +128,14 @@ impl Product { /// /// Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. pub fn retrieve(client: &Client, id: &ProductId, expand: &[&str]) -> Response { - client.get_query(&format!("/products/{}", id), &Expand { expand }) + client.get_query(&format!("/products/{}", id), Expand { expand }) } /// Updates the specific product by setting the values of the parameters passed. /// /// Any parameters not provided will be left unchanged. pub fn update(client: &Client, id: &ProductId, params: UpdateProduct<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/products/{}", id), ¶ms) } diff --git a/src/resources/generated/promotion_code.rs b/src/resources/generated/promotion_code.rs index c6b3b5b5f..f781df8ab 100644 --- a/src/resources/generated/promotion_code.rs +++ b/src/resources/generated/promotion_code.rs @@ -62,7 +62,7 @@ pub struct PromotionCode { impl PromotionCode { /// Returns a list of your promotion codes. pub fn list(client: &Client, params: &ListPromotionCodes<'_>) -> Response> { - client.get_query("/promotion_codes", ¶ms) + client.get_query("/promotion_codes", params) } /// Retrieves the promotion code with the given ID. @@ -73,7 +73,7 @@ impl PromotionCode { id: &PromotionCodeId, expand: &[&str], ) -> Response { - client.get_query(&format!("/promotion_codes/{}", id), &Expand { expand }) + client.get_query(&format!("/promotion_codes/{}", id), Expand { expand }) } /// Updates the specified promotion code by setting the values of the parameters passed. @@ -84,6 +84,7 @@ impl PromotionCode { id: &PromotionCodeId, params: UpdatePromotionCode<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/promotion_codes/{}", id), ¶ms) } } diff --git a/src/resources/generated/quote.rs b/src/resources/generated/quote.rs index a7b3beac3..d02645a48 100644 --- a/src/resources/generated/quote.rs +++ b/src/resources/generated/quote.rs @@ -146,12 +146,12 @@ pub struct Quote { impl Quote { /// Returns a list of your quotes. pub fn list(client: &Client, params: &ListQuotes<'_>) -> Response> { - client.get_query("/quotes", ¶ms) + client.get_query("/quotes", params) } /// Retrieves the quote with the given ID. pub fn retrieve(client: &Client, id: &QuoteId, expand: &[&str]) -> Response { - client.get_query(&format!("/quotes/{}", id), &Expand { expand }) + client.get_query(&format!("/quotes/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/refund.rs b/src/resources/generated/refund.rs index eec7f5897..f91a9b9a9 100644 --- a/src/resources/generated/refund.rs +++ b/src/resources/generated/refund.rs @@ -98,7 +98,7 @@ impl Refund { /// /// We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. pub fn list(client: &Client, params: &ListRefunds<'_>) -> Response> { - client.get_query("/refunds", ¶ms) + client.get_query("/refunds", params) } /// When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. @@ -113,18 +113,20 @@ impl Refund { /// This method will raise an error when called on an already-refunded charge, /// or when trying to refund more money than is left on a charge. pub fn create(client: &Client, params: CreateRefund<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/refunds", ¶ms) } /// Retrieves the details of an existing refund. pub fn retrieve(client: &Client, id: &RefundId, expand: &[&str]) -> Response { - client.get_query(&format!("/refunds/{}", id), &Expand { expand }) + client.get_query(&format!("/refunds/{}", id), Expand { expand }) } /// Updates the refund that you specify by setting the values of the passed parameters. /// /// Any parameters that you don’t provide remain unchanged. This request only accepts `metadata` as an argument. pub fn update(client: &Client, id: &RefundId, params: UpdateRefund<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/refunds/{}", id), ¶ms) } } diff --git a/src/resources/generated/review.rs b/src/resources/generated/review.rs index 3cb8a20f3..85e11b7e2 100644 --- a/src/resources/generated/review.rs +++ b/src/resources/generated/review.rs @@ -70,12 +70,12 @@ impl Review { /// /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. pub fn list(client: &Client, params: &ListReviews<'_>) -> Response> { - client.get_query("/reviews", ¶ms) + client.get_query("/reviews", params) } /// Retrieves a `Review` object. pub fn retrieve(client: &Client, id: &ReviewId, expand: &[&str]) -> Response { - client.get_query(&format!("/reviews/{}", id), &Expand { expand }) + client.get_query(&format!("/reviews/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs index 3a920a65d..d1ac95b81 100644 --- a/src/resources/generated/setup_attempt.rs +++ b/src/resources/generated/setup_attempt.rs @@ -74,7 +74,7 @@ pub struct SetupAttempt { impl SetupAttempt { /// Returns a list of SetupAttempts that associate with a provided SetupIntent. pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response> { - client.get_query("/setup_attempts", ¶ms) + client.get_query("/setup_attempts", params) } } diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index 1decdd8e6..bf16a0048 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -127,7 +127,7 @@ pub struct SetupIntent { impl SetupIntent { /// Returns a list of SetupIntents. pub fn list(client: &Client, params: &ListSetupIntents<'_>) -> Response> { - client.get_query("/setup_intents", ¶ms) + client.get_query("/setup_intents", params) } /// Creates a SetupIntent object. @@ -135,6 +135,7 @@ impl SetupIntent { /// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) /// it to collect any required permissions to charge the payment method later. pub fn create(client: &Client, params: CreateSetupIntent<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/setup_intents", ¶ms) } @@ -144,7 +145,7 @@ impl SetupIntent { /// When retrieved with a publishable key, only a subset of properties will be returned. /// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. pub fn retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) -> Response { - client.get_query(&format!("/setup_intents/{}", id), &Expand { expand }) + client.get_query(&format!("/setup_intents/{}", id), Expand { expand }) } /// Updates a SetupIntent object. @@ -153,6 +154,7 @@ impl SetupIntent { id: &SetupIntentId, params: UpdateSetupIntent<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/setup_intents/{}", id), ¶ms) } } diff --git a/src/resources/generated/shipping_rate.rs b/src/resources/generated/shipping_rate.rs index 62ead279e..6f77c617a 100644 --- a/src/resources/generated/shipping_rate.rs +++ b/src/resources/generated/shipping_rate.rs @@ -70,11 +70,12 @@ pub struct ShippingRate { impl ShippingRate { /// Returns a list of your shipping rates. pub fn list(client: &Client, params: &ListShippingRates<'_>) -> Response> { - client.get_query("/shipping_rates", ¶ms) + client.get_query("/shipping_rates", params) } /// Creates a new shipping rate object. pub fn create(client: &Client, params: CreateShippingRate<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/shipping_rates", ¶ms) } @@ -84,7 +85,7 @@ impl ShippingRate { id: &ShippingRateId, expand: &[&str], ) -> Response { - client.get_query(&format!("/shipping_rates/{}", id), &Expand { expand }) + client.get_query(&format!("/shipping_rates/{}", id), Expand { expand }) } /// Updates an existing shipping rate object. @@ -93,6 +94,7 @@ impl ShippingRate { id: &ShippingRateId, params: UpdateShippingRate<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/shipping_rates/{}", id), ¶ms) } } diff --git a/src/resources/generated/source.rs b/src/resources/generated/source.rs index 612b2f5a5..ac36b8aef 100644 --- a/src/resources/generated/source.rs +++ b/src/resources/generated/source.rs @@ -162,11 +162,12 @@ pub struct Source { impl Source { /// List source transactions for a given source. pub fn list(client: &Client, params: &ListSources<'_>) -> Response> { - client.get_query("/sources/{source}/source_transactions", ¶ms) + client.get_query("/sources/{source}/source_transactions", params) } /// Creates a new source object. pub fn create(client: &Client, params: CreateSource<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/sources", ¶ms) } @@ -174,7 +175,7 @@ impl Source { /// /// Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. pub fn retrieve(client: &Client, id: &SourceId, expand: &[&str]) -> Response { - client.get_query(&format!("/sources/{}", id), &Expand { expand }) + client.get_query(&format!("/sources/{}", id), Expand { expand }) } /// Updates the specified source by setting the values of the parameters passed. @@ -183,6 +184,7 @@ impl Source { /// It is also possible to update type specific information for selected payment methods. /// Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. pub fn update(client: &Client, id: &SourceId, params: UpdateSource<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/sources/{}", id), ¶ms) } } diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs index a65328e78..584b44d6d 100644 --- a/src/resources/generated/subscription.rs +++ b/src/resources/generated/subscription.rs @@ -215,13 +215,14 @@ impl Subscription { /// /// In order to list canceled subscriptions, specify `status=canceled`. pub fn list(client: &Client, params: &ListSubscriptions<'_>) -> Response> { - client.get_query("/subscriptions", ¶ms) + client.get_query("/subscriptions", params) } /// Creates a new subscription on an existing customer. /// /// Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with `collection_method=charge_automatically`, the first invoice is finalized as part of the request. The `payment_behavior` parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a `draft` status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. pub fn create(client: &Client, params: CreateSubscription<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/subscriptions", ¶ms) } @@ -231,7 +232,7 @@ impl Subscription { id: &SubscriptionId, expand: &[&str], ) -> Response { - client.get_query(&format!("/subscriptions/{}", id), &Expand { expand }) + client.get_query(&format!("/subscriptions/{}", id), Expand { expand }) } /// Updates an existing subscription to match the specified parameters. @@ -255,6 +256,7 @@ impl Subscription { id: &SubscriptionId, params: UpdateSubscription<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/subscriptions/{}", id), ¶ms) } diff --git a/src/resources/generated/subscription_item.rs b/src/resources/generated/subscription_item.rs index dd5929829..1f7a75dcc 100644 --- a/src/resources/generated/subscription_item.rs +++ b/src/resources/generated/subscription_item.rs @@ -64,7 +64,7 @@ impl SubscriptionItem { client: &Client, params: &ListSubscriptionItems<'_>, ) -> Response> { - client.get_query("/subscription_items", ¶ms) + client.get_query("/subscription_items", params) } /// Adds a new item to an existing subscription. @@ -74,6 +74,7 @@ impl SubscriptionItem { client: &Client, params: CreateSubscriptionItem<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/subscription_items", ¶ms) } @@ -83,7 +84,7 @@ impl SubscriptionItem { id: &SubscriptionItemId, expand: &[&str], ) -> Response { - client.get_query(&format!("/subscription_items/{}", id), &Expand { expand }) + client.get_query(&format!("/subscription_items/{}", id), Expand { expand }) } /// Updates the plan or quantity of an item on a current subscription. @@ -92,6 +93,7 @@ impl SubscriptionItem { id: &SubscriptionItemId, params: UpdateSubscriptionItem<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/subscription_items/{}", id), ¶ms) } diff --git a/src/resources/generated/subscription_schedule.rs b/src/resources/generated/subscription_schedule.rs index 99a9030af..d87c79a48 100644 --- a/src/resources/generated/subscription_schedule.rs +++ b/src/resources/generated/subscription_schedule.rs @@ -93,7 +93,7 @@ impl SubscriptionSchedule { client: &Client, params: &ListSubscriptionSchedules<'_>, ) -> Response> { - client.get_query("/subscription_schedules", ¶ms) + client.get_query("/subscription_schedules", params) } /// Creates a new subscription schedule object. @@ -103,6 +103,7 @@ impl SubscriptionSchedule { client: &Client, params: CreateSubscriptionSchedule<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/subscription_schedules", ¶ms) } @@ -114,7 +115,7 @@ impl SubscriptionSchedule { id: &SubscriptionScheduleId, expand: &[&str], ) -> Response { - client.get_query(&format!("/subscription_schedules/{}", id), &Expand { expand }) + client.get_query(&format!("/subscription_schedules/{}", id), Expand { expand }) } /// Updates an existing subscription schedule. @@ -123,6 +124,7 @@ impl SubscriptionSchedule { id: &SubscriptionScheduleId, params: UpdateSubscriptionSchedule<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/subscription_schedules/{}", id), ¶ms) } } diff --git a/src/resources/generated/tax_code.rs b/src/resources/generated/tax_code.rs index 324517cde..0cfa2ed73 100644 --- a/src/resources/generated/tax_code.rs +++ b/src/resources/generated/tax_code.rs @@ -26,14 +26,14 @@ pub struct TaxCode { impl TaxCode { /// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. pub fn list(client: &Client, params: &ListTaxCodes<'_>) -> Response> { - client.get_query("/tax_codes", ¶ms) + client.get_query("/tax_codes", params) } /// Retrieves the details of an existing tax code. /// /// Supply the unique tax code ID and Stripe will return the corresponding tax code information. pub fn retrieve(client: &Client, id: &TaxCodeId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_codes/{}", id), &Expand { expand }) + client.get_query(&format!("/tax_codes/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/tax_id.rs b/src/resources/generated/tax_id.rs index acf08422e..a637ea016 100644 --- a/src/resources/generated/tax_id.rs +++ b/src/resources/generated/tax_id.rs @@ -62,17 +62,18 @@ pub struct TaxId { impl TaxId { /// Returns a list of tax IDs. pub fn list(client: &Client, params: &ListTaxIds<'_>) -> Response> { - client.get_query("/tax_ids", ¶ms) + client.get_query("/tax_ids", params) } /// Creates a new account or customer `tax_id` object. pub fn create(client: &Client, params: CreateTaxId<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/tax_ids", ¶ms) } /// Retrieves an account or customer `tax_id` object. pub fn retrieve(client: &Client, id: &TaxIdId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_ids/{}", id), &Expand { expand }) + client.get_query(&format!("/tax_ids/{}", id), Expand { expand }) } /// Deletes an existing account or customer `tax_id` object. diff --git a/src/resources/generated/tax_rate.rs b/src/resources/generated/tax_rate.rs index 9000974df..d73dded86 100644 --- a/src/resources/generated/tax_rate.rs +++ b/src/resources/generated/tax_rate.rs @@ -83,21 +83,23 @@ impl TaxRate { /// /// Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. pub fn list(client: &Client, params: &ListTaxRates<'_>) -> Response> { - client.get_query("/tax_rates", ¶ms) + client.get_query("/tax_rates", params) } /// Creates a new tax rate. pub fn create(client: &Client, params: CreateTaxRate<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/tax_rates", ¶ms) } /// Retrieves a tax rate with the given ID. pub fn retrieve(client: &Client, id: &TaxRateId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_rates/{}", id), &Expand { expand }) + client.get_query(&format!("/tax_rates/{}", id), Expand { expand }) } /// Updates an existing tax rate. pub fn update(client: &Client, id: &TaxRateId, params: UpdateTaxRate<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/tax_rates/{}", id), ¶ms) } } diff --git a/src/resources/generated/terminal_configuration.rs b/src/resources/generated/terminal_configuration.rs index bdf26ba45..e03396e73 100644 --- a/src/resources/generated/terminal_configuration.rs +++ b/src/resources/generated/terminal_configuration.rs @@ -48,7 +48,7 @@ impl TerminalConfiguration { client: &Client, params: &ListTerminalConfigurations<'_>, ) -> Response> { - client.get_query("/terminal/configurations", ¶ms) + client.get_query("/terminal/configurations", params) } /// Creates a new `Configuration` object. @@ -56,6 +56,7 @@ impl TerminalConfiguration { client: &Client, params: CreateTerminalConfiguration<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/terminal/configurations", ¶ms) } } diff --git a/src/resources/generated/terminal_connection_token.rs b/src/resources/generated/terminal_connection_token.rs index 3d3eff1f3..487f3dc58 100644 --- a/src/resources/generated/terminal_connection_token.rs +++ b/src/resources/generated/terminal_connection_token.rs @@ -31,6 +31,7 @@ impl TerminalConnectionToken { client: &Client, params: CreateTerminalConnectionToken<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/terminal/connection_tokens", ¶ms) } } diff --git a/src/resources/generated/terminal_location.rs b/src/resources/generated/terminal_location.rs index e8c28dd23..d3cf75122 100644 --- a/src/resources/generated/terminal_location.rs +++ b/src/resources/generated/terminal_location.rs @@ -49,7 +49,7 @@ impl TerminalLocation { client: &Client, params: &ListTerminalLocations<'_>, ) -> Response> { - client.get_query("/terminal/locations", ¶ms) + client.get_query("/terminal/locations", params) } /// Creates a new `Location` object. @@ -58,6 +58,7 @@ impl TerminalLocation { client: &Client, params: CreateTerminalLocation<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/terminal/locations", ¶ms) } } diff --git a/src/resources/generated/terminal_reader.rs b/src/resources/generated/terminal_reader.rs index c3454ca8c..5e4c8b291 100644 --- a/src/resources/generated/terminal_reader.rs +++ b/src/resources/generated/terminal_reader.rs @@ -70,11 +70,12 @@ impl TerminalReader { client: &Client, params: &ListTerminalReaders<'_>, ) -> Response> { - client.get_query("/terminal/readers", ¶ms) + client.get_query("/terminal/readers", params) } /// Creates a new `Reader` object. pub fn create(client: &Client, params: CreateTerminalReader<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/terminal/readers", ¶ms) } } diff --git a/src/resources/generated/token.rs b/src/resources/generated/token.rs index fd6001383..4f16f3ad4 100644 --- a/src/resources/generated/token.rs +++ b/src/resources/generated/token.rs @@ -49,12 +49,13 @@ impl Token { /// You can only use this token once. /// To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). pub fn create(client: &Client, params: CreateToken<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/tokens", ¶ms) } /// Retrieves the token with the given ID. pub fn retrieve(client: &Client, id: &TokenId, expand: &[&str]) -> Response { - client.get_query(&format!("/tokens/{}", id), &Expand { expand }) + client.get_query(&format!("/tokens/{}", id), Expand { expand }) } } diff --git a/src/resources/generated/topup.rs b/src/resources/generated/topup.rs index 75d9946a4..915ab6e2e 100644 --- a/src/resources/generated/topup.rs +++ b/src/resources/generated/topup.rs @@ -81,20 +81,21 @@ pub struct Topup { impl Topup { /// Returns a list of top-ups. pub fn list(client: &Client, params: &ListTopups<'_>) -> Response> { - client.get_query("/topups", ¶ms) + client.get_query("/topups", params) } /// Retrieves the details of a top-up that has previously been created. /// /// Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. pub fn retrieve(client: &Client, id: &TopupId, expand: &[&str]) -> Response { - client.get_query(&format!("/topups/{}", id), &Expand { expand }) + client.get_query(&format!("/topups/{}", id), Expand { expand }) } /// Updates the metadata of a top-up. /// /// Other top-up details are not editable by design. pub fn update(client: &Client, id: &TopupId, params: UpdateTopup<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/topups/{}", id), ¶ms) } } diff --git a/src/resources/generated/transfer.rs b/src/resources/generated/transfer.rs index 2bfad37c1..ebe462785 100644 --- a/src/resources/generated/transfer.rs +++ b/src/resources/generated/transfer.rs @@ -84,13 +84,14 @@ impl Transfer { /// /// The transfers are returned in sorted order, with the most recently created transfers appearing first. pub fn list(client: &Client, params: &ListTransfers<'_>) -> Response> { - client.get_query("/transfers", ¶ms) + client.get_query("/transfers", params) } /// To send funds from your Stripe account to a connected account, you create a new transfer object. /// /// Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error. pub fn create(client: &Client, params: CreateTransfer<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/transfers", ¶ms) } @@ -98,7 +99,7 @@ impl Transfer { /// /// Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. pub fn retrieve(client: &Client, id: &TransferId, expand: &[&str]) -> Response { - client.get_query(&format!("/transfers/{}", id), &Expand { expand }) + client.get_query(&format!("/transfers/{}", id), Expand { expand }) } /// Updates the specified transfer by setting the values of the parameters passed. @@ -109,6 +110,7 @@ impl Transfer { id: &TransferId, params: UpdateTransfer<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/transfers/{}", id), ¶ms) } } diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs index 0cccadfda..dc8f5261e 100644 --- a/src/resources/generated/webhook_endpoint.rs +++ b/src/resources/generated/webhook_endpoint.rs @@ -78,7 +78,7 @@ impl WebhookEndpoint { client: &Client, params: &ListWebhookEndpoints<'_>, ) -> Response> { - client.get_query("/webhook_endpoints", ¶ms) + client.get_query("/webhook_endpoints", params) } /// A webhook endpoint must have a `url` and a list of `enabled_events`. @@ -87,6 +87,7 @@ impl WebhookEndpoint { /// If set to true, then a Connect webhook endpoint that notifies the specified `url` about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified `url` only about events from your account is created. /// You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. pub fn create(client: &Client, params: CreateWebhookEndpoint<'_>) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form("/webhook_endpoints", ¶ms) } @@ -96,7 +97,7 @@ impl WebhookEndpoint { id: &WebhookEndpointId, expand: &[&str], ) -> Response { - client.get_query(&format!("/webhook_endpoints/{}", id), &Expand { expand }) + client.get_query(&format!("/webhook_endpoints/{}", id), Expand { expand }) } /// Updates the webhook endpoint. @@ -107,6 +108,7 @@ impl WebhookEndpoint { id: &WebhookEndpointId, params: UpdateWebhookEndpoint<'_>, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/webhook_endpoints/{}", id), ¶ms) } diff --git a/src/resources/login_links_ext.rs b/src/resources/login_links_ext.rs index e8a26cf26..4970dfeaa 100644 --- a/src/resources/login_links_ext.rs +++ b/src/resources/login_links_ext.rs @@ -21,6 +21,7 @@ impl LoginLink { let create_login_link = CreateLoginLink { expand: &[], redirect_url: Some(redirect_url.to_string()) }; + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/accounts/{}/login_links", id), &create_login_link) } } diff --git a/src/resources/setup_intent_ext.rs b/src/resources/setup_intent_ext.rs index 7fdf31ef4..6fdc924fb 100644 --- a/src/resources/setup_intent_ext.rs +++ b/src/resources/setup_intent_ext.rs @@ -39,6 +39,7 @@ impl SetupIntent { setup_id: &SetupIntentId, params: ConfirmSetupIntent, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form(&format!("/setup_intents/{}/confirm", setup_id), ¶ms) } diff --git a/src/resources/usage_record_ext.rs b/src/resources/usage_record_ext.rs index 07032e59b..564e6a81e 100644 --- a/src/resources/usage_record_ext.rs +++ b/src/resources/usage_record_ext.rs @@ -8,6 +8,7 @@ impl UsageRecord { subscription_item_id: &SubscriptionItemId, params: CreateUsageRecord, ) -> Response { + #[allow(clippy::needless_borrows_for_generic_args)] client.post_form( &format!("/subscription_items/{}/usage_records", subscription_item_id), ¶ms, diff --git a/src/resources/webhook_events.rs b/src/resources/webhook_events.rs index b041771d3..2397858f4 100644 --- a/src/resources/webhook_events.rs +++ b/src/resources/webhook_events.rs @@ -405,7 +405,7 @@ pub enum EventType { impl std::fmt::Display for EventType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(&serde_json::to_string(self).unwrap()) + f.write_str(&serde_json::to_string(self).expect("serializing EventType should not fail")) } }