Skip to content

Commit

Permalink
Address initial comments and fix openapi clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mzeitlin11 committed Dec 1, 2023
1 parent 975440d commit cfb4fd0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 39 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ exclude = ["openapi"]
[workspace.package]
version = "0.22.2"
description = "API bindings for the Stripe HTTP API"
rust-version = "1.67.0"
rust-version = "1.68.0"
authors = [
"Anna Baldwin <abaldwin@developers.wyyerd.com>",
"Kevin Stenerson <kestred@users.noreply.github.com>",
"Alexander Lyon <arlyon@me.com>",
"Matthew Zeitlin <mzeitlin11@gmail.com>"
]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
1 change: 0 additions & 1 deletion async-stripe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// except according to those terms.

#![doc(html_root_url = "https://docs.rs/async-stripe/")]
#![recursion_limit = "128"]

//! This crate provides Rust bindings to the Stripe HTTP API.
//!
Expand Down
26 changes: 0 additions & 26 deletions examples/strategy.rs

This file was deleted.

20 changes: 10 additions & 10 deletions openapi/src/stripe_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::HashMap;

use heck::ToSnakeCase;
use indexmap::IndexMap;
use lazy_static::lazy_static;
use openapiv3::Schema;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -255,17 +256,16 @@ impl StripeResource {
}
}

fn object_renames() -> HashMap<&'static str, &'static str> {
return HashMap::from([
("invoiceitem", "invoice_item"),
("item", "checkout_session_item"),
("line_item", "invoice_line_item"),
("fee_refund", "application_fee_refund"),
]);
}

fn infer_object_ident(path: &ComponentPath) -> RustIdent {
if let Some(renamed) = object_renames().get(path.as_ref()) {
lazy_static! {
static ref OBJECT_RENAMES: HashMap<&'static str, &'static str> = HashMap::from([
("invoiceitem", "invoice_item"),
("item", "checkout_session_item"),
("line_item", "invoice_line_item"),
("fee_refund", "application_fee_refund"),
]);
}
if let Some(renamed) = OBJECT_RENAMES.get(path.as_ref()) {
RustIdent::create(renamed)
} else {
RustIdent::create(path)
Expand Down
1 change: 0 additions & 1 deletion stripe_types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![recursion_limit = "128"]
// FIXME: could be worked around in the codegen
#![allow(clippy::large_enum_variant)]
// FIXME: probably fixable with better doc comment formatting, but stripe might also just have doc typos at times that break the regex
Expand Down
File renamed without changes.

0 comments on commit cfb4fd0

Please sign in to comment.