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

Require Rust 1.62 for enum defaults #251

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Conversation

jbourassa
Copy link
Contributor

All our examples use codegen from graphql_client_codegen which uses enum defaults which are only supported as of 1.62.

This commit makes that requirement explicit for a more helpful error message:

$ cargo build
error: package [..] ([.. path..]])` cannot be built because it
requires rustc 1.62.0 or newer, while the currently active rustc
version is 1.61.0

Copy link
Contributor

@andrewhassan andrewhassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! I noticed some spots where it wasn't updated. Should we update them here too for consistency? Or are you only requiring it in functions that need it?

  • checkout/rust/cart-checkout-validation/default/Cargo.toml.liquid
  • checkout/rust/cart-transform/default/Cargo.toml.liquid
  • checkout/rust/payment-customization/default/Cargo.toml.liquid
  • discounts/rust/order-discounts/fixed-amount/Cargo.toml
  • discounts/rust/product-discounts/fixed-amount/Cargo.toml
  • discounts/rust/shipping-discounts/fixed-amount/Cargo.toml

All our examples use codegen from `graphql_client_codegen` which
uses [enum defaults][1] which are only [supported as of 1.62][2].

This commit makes that requirement explicit for a more helpful error
message:

> $ cargo build
> error: package [..] ([.. path..]])` cannot be built because it
> requires rustc 1.62.0 or newer, while the currently active rustc
> version is 1.61.0

[1]: https://github.com/graphql-rust/graphql-client/blob/33b8a34aabbaaac9977a93763ae445dc64b5c67c/graphql_client_codegen/src/deprecation.rs#L10-L20
[2]: rust-lang/rust#94457 (comment)
@jbourassa
Copy link
Contributor Author

jbourassa commented Jun 1, 2023

Thanks for doing this! I noticed some spots where it wasn't updated.

Of course we should, thanks for noticing. I don't know why but rg --files | grep Cargo.toml did not pick all the Cargo.toml files 😮 (but rg --files -g '**/Cargo.toml**' does). I am very confused.

Anyways, fixed!

Copy link
Contributor

@andrewhassan andrewhassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! Thanks for updating!

@jbourassa jbourassa merged commit ba9edd4 into main Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants