You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling with the feature flag Events with minimal other feature flags and no default features, there is a compilation error:
error[E0432]: unresolved import `chrono`
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.31.0/src/resources/webhook_e
vents.rs:3:5
|
3 | use chrono::Utc;
| ^^^^^^ use of undeclared crate or module `chrono`
error[E0412]: cannot find type `AccountCapabilities` inthis scope
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.31.0/src/resources/webhook
_events.rs:428:25
|
428 | AccountCapabilities(AccountCapabilities),
| ^^^^^^^^^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::AccountCapabilities`; try using the variant's enum
|
428 | AccountCapabilities(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
Some errors have detailed explanations:E0412,E0432.For more information about an error, try `rustc --explain E0412`.
error: could not compile `async-stripe` (lib) due to 2 previous errors
It seems that the current architecture of the Event struct mandates the inclusion of ALL the feature-walled APIs. This is unfortunate because I only need a few of the features and Rust-Analyzer usually takes ages to index stripe. I understand that this would be a very difficult (maybe impossible) issue to tackle with a general solution. In the meantime, it would be good to change the feature in Cargo.toml to also include however many other features it needs (or alternatively full).
To Reproduce
Add async-stripe to Cargo.toml as follows: async-stripe = { version = "0.31.0", default-features = false, features = ["runtime-blocking-rustls", "events"] }
Compile and see the error. The error will likely differ from the one I provided because that was compiled with the checkout feature as well.
Expected behavior
The Events feature flag includes any other features required to compile. Otherwise, it is clearly documented that this is not the case.
Code snippets
No response
OS
NixOS
Rust version
1.78.0-nightly
Library version
async-stripe 0.34.1
API version
2023-10-16
Additional context
Error produced via reproduction steps:
rust/stripe_parse_test on master [!?] is 📦 v0.1.0 via 🦀 v1.76.0 via ❄ impure (nix-shell) took 3m16s
❯ cargo run
Compiling async-stripe v0.34.1
error[E0432]: unresolved import `chrono`
--> /home/patrick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/webhook_e
|
3 | use chrono::Utc;
| ^^^^^^ use of undeclared crate or module `chrono`
error[E0412]: cannot find type `AccountCapabilities` in this scope
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/webhook
|
428 | AccountCapabilities(AccountCapabilities),
| ^^^^^^^^^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::AccountCapabilities`; try using the variant's enum
|
428 | AccountCapabilities(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `BillingPortalConfiguration` in this scope
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/webhook_events.rs:436:32
|
436 | BillingPortalConfiguration(BillingPortalConfiguration),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::BillingPortalConfiguration`; try using the variant's enum
|
436 | BillingPortalConfiguration(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `PaymentLink` in this scope
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/webhook_events.rs:461:17
|
461 | PaymentLink(PaymentLink),
| ^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::PaymentLink`; try using the variant's enum
|
461 | PaymentLink(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `PromotionCode` in this scope
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/webhook_events.rs:468:19
|
468 | PromotionCode(PromotionCode),
| ^^^^^^^^^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::PromotionCode`; try using the variant's enum
|
468 | PromotionCode(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `Quote` in this scope
--> /home/*****/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-stripe-0.34.1/src/resources/webhook_events.rs:469:11
|
469 | Quote(Quote),
| ^^^^^ not found in this scope
|
help: there is an enum variant `crate::EventObject::Quote` and 1 other; try using the variant's enum
|
469 | Quote(crate::EventObject),
| ~~~~~~~~~~~~~~~~~~
469 | Quote(serde_json::ser::CharEscape),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some errors have detailed explanations: E0412, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `async-stripe` (lib) due to 6 previous errors
The text was updated successfully, but these errors were encountered:
I'd like to tackle this with proc macros, but I don't have the experience (or really, the time) to do so right now. I image it would be feasible but require some changes to the code or some metadata provided. Otherwise, the macro may have to search through the entire project to find the feature flags that the elements are behind. I'm still not completely sure how to do this, but I'll look into it and consider a PR if I get somewhere.
Describe the bug
When compiling with the feature flag
Events
with minimal other feature flags and no default features, there is a compilation error:It seems that the current architecture of the Event struct mandates the inclusion of ALL the feature-walled APIs. This is unfortunate because I only need a few of the features and Rust-Analyzer usually takes ages to index stripe. I understand that this would be a very difficult (maybe impossible) issue to tackle with a general solution. In the meantime, it would be good to change the feature in Cargo.toml to also include however many other features it needs (or alternatively
full
).To Reproduce
async-stripe = { version = "0.31.0", default-features = false, features = ["runtime-blocking-rustls", "events"] }
checkout
feature as well.Expected behavior
The
Events
feature flag includes any other features required to compile. Otherwise, it is clearly documented that this is not the case.Code snippets
No response
OS
NixOS
Rust version
1.78.0-nightly
Library version
async-stripe 0.34.1
API version
2023-10-16
Additional context
Error produced via reproduction steps:
The text was updated successfully, but these errors were encountered: