Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: align differently used Rust versions #658

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions .github/workflows/async-stripe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@1.82.0
with:
toolchain: nightly
components: rustfmt
- uses: davidB/rust-cargo-make@v1
- name: regenerate openapi
Expand All @@ -26,9 +25,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@1.82.0
with:
toolchain: nightly
components: rustfmt
- uses: davidB/rust-cargo-make@v1
- name: regenerate openapi
Expand Down Expand Up @@ -56,9 +54,8 @@ jobs:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@1.82.0
with:
toolchain: stable
components: clippy
- run: cargo clippy -p stripe-openapi-codegen --tests

Expand All @@ -80,9 +77,8 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@1.82.0
with:
toolchain: stable
components: clippy
- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -121,9 +117,7 @@ jobs:
- 12112:12112
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: "1.78.0"
- uses: dtolnay/[email protected]
- uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -152,12 +146,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: "nightly-2024-10-18"
- name: Install cargo-public-api
uses: baptiste0928/cargo-install@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install minimal nightly with rustfmt
uses: dtolnay/rust-toolchain@v1
- name: Install toolchain 1.82.0 with rustfmt
uses: dtolnay/rust-toolchain@1.82.0
with:
toolchain: nightly
components: rustfmt
- uses: davidB/rust-cargo-make@v1
- name: regenerate openapi
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: "1.78.0"
- uses: dtolnay/[email protected]
- uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Test it: `cargo test --features runtime-blocking`
4. Lint it: `cargo +nightly clippy --all --all-targets -- -D warnings`
4. Lint it: `cargo +1.82.0 clippy --all --all-targets -- -D warnings`
5. Commit your changes: `git commit -am 'Add some feature'`
6. Push to the branch: `git push origin my-new-feature`
7. Submit a pull request :D
Expand Down Expand Up @@ -89,4 +89,3 @@ In some cases, it is helpful to have additional logic associated with a datatype
capture a create `Charge` object. This additional impl goes in the `charge_ext.rs` file in the
`resources` folder, to provide a clean seperation between generated and hand maintained files.
If you notice that logic is missing, please add it to (or create) the appropriate `ext` file.

9 changes: 6 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,21 @@ rg -N --no-filename -i '^pub (struct|enum) ([A-Z][a-zA-z0-9]+).*?$' src/resourc
[tasks.openapi-generate-no-fetch]
cwd = "openapi"
command = "cargo"
toolchain = "1.82.0"
args = ["run", "spec3.sdk.json"]
dependencies = ["openapi-delete-out"]

[tasks.openapi-generate]
cwd = "openapi"
command = "cargo"
toolchain = "1.82.0"
args = ["run", "spec3.sdk.json", "--fetch", "current"]
dependencies = ["openapi-delete-out"]

[tasks.openapi-generate-latest]
cwd = "openapi"
command = "cargo"
toolchain = "1.82.0"
args = ["run", "spec3.sdk.json", "--fetch", "latest"]
dependencies = ["openapi-delete-out"]

Expand All @@ -57,16 +60,16 @@ args = ["-a", "--delete-during", "out/", "../src/resources/generated"]

[tasks.fmt]
command = "cargo"
toolchain = "nightly"
toolchain = "1.82.0"
install_crate = "rustfmt"
# we set this to true because missing files currently cause rustfmt to fail
# which impacts our weekly CI job
ignore_errors = true
ignore_errors = true
args = ["fmt"]

[tasks.check]
command = "cargo"
toolchain = "nightly"
toolchain = "1.82.0"
install_crate = "rustfmt"
args = ["fmt", "--", "--check"]

Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::AccountId;
use crate::params::{
Expand All @@ -13,6 +11,7 @@ use crate::resources::{
Address, Currency, DelayDays, ExternalAccount, File, Person, PersonVerificationParams, TaxId,
VerificationDocumentParams,
};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Account".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/account_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::AccountId;
use crate::params::{Expand, Object, Timestamp};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "AccountLink".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/api_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::resources::{PaymentIntent, PaymentMethod, PaymentSource, SetupIntent};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "APIErrors".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::ids::ApplicationId;
use crate::params::Object;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Application".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/application_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::{ApplicationFeeId, ChargeId};
use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp};
use crate::resources::{
Account, Application, ApplicationFeeRefund, BalanceTransaction, Charge, Currency,
};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "PlatformFee".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::params::Object;
use crate::resources::{BalanceAmountBySourceType, Currency};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Balance".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/balance_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::{BalanceTransactionId, PayoutId, SourceId};
use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp};
use crate::resources::{
BalanceTransactionSourceUnion, BalanceTransactionStatus, Currency, FeeType,
};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "BalanceTransaction".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/bank_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::ids::BankAccountId;
use crate::params::{Expandable, Metadata, Object};
use crate::resources::{Account, BankAccountStatus, Currency, Customer};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "BankAccount".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/billing_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::resources::Address;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "billing_details".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/billing_portal_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::ids::BillingPortalConfigurationId;
use crate::params::{Expandable, Metadata, Object, Timestamp};
use crate::resources::Application;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "PortalConfiguration".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/billing_portal_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::{BillingPortalSessionId, CustomerId};
use crate::params::{Expand, Expandable, Object, Timestamp};
use crate::resources::BillingPortalConfiguration;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "PortalSession".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::ids::CardId;
use crate::params::{Expandable, Metadata, Object};
use crate::resources::{Account, Currency, Customer};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Card".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/cash_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::params::Object;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "cash_balance".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::{ChargeId, CustomerId, PaymentIntentId};
use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp};
Expand All @@ -14,6 +12,7 @@ use crate::resources::{
PaymentMethodDetailsCardWalletGooglePay, PaymentSource, RadarRadarOptions, Refund, Review,
Shipping, Transfer,
};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Charge".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::{
CheckoutSessionId, CustomerId, PaymentIntentId, PaymentLinkId, PaymentMethodConfigurationId,
Expand All @@ -19,6 +17,7 @@ use crate::resources::{
PaymentMethodOptionsCustomerBalanceEuBankAccount, SetupIntent, Shipping, ShippingRate,
Subscription, TaxId, TaxRate,
};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Session".
///
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/connect_account_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::params::Expandable;
use crate::resources::Account;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "ConnectAccountReference".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/connect_collection_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::ids::ConnectCollectionTransferId;
use crate::params::{Expandable, Object};
use crate::resources::{Account, Currency};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "ConnectCollectionTransfer".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/coupon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::CouponId;
use crate::params::{
CurrencyMap, Deleted, Expand, List, Metadata, Object, Paginable, RangeQuery, Timestamp,
};
use crate::resources::Currency;
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "Coupon".
///
Expand Down
Loading