async-stripe
async-stripe copied to clipboard
fails to compile without runtime
Describe the bug
makes sense to reexport some of the types to a frontend, not clear why a runtime is required
To Reproduce
cargo build --no-default-features
Expected behavior
builds fine
Code snippets
No response
OS
any
Rust version
any
Library version
since build.rs was added 7mo ago
API version
not stripe related
Additional context
No response
The library is not designed to just expose the types but I am open to a change that adapts it to do so, as there is nothing that inherently prevents it.
An extra use case. I'm building a crate with small testing utilities. I want to generate fake payment ids so that my structs can easily use the Fake treat from fake
crate like:
use std::str::FromStr;
use fake::{Fake, StringFaker};
use stripe::PaymentIntentId;
const ALPHANUMERIC: &str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
pub fn fake_payment_intent_id() -> PaymentIntentId {
let payment_id_faker = StringFaker::with(Vec::from(ALPHANUMERIC), 24);
let id: String = payment_id_faker.fake();
PaymentIntentId::from_str(&format!("pi_{id}")).expect("PaymentIntentId faker should work")
}
The problem is that I have to include a runtime and what is supposed to be a tiny crate now it's blown out of proportion in terms of size and compilation time
This issue will be fixed in the next release. please see the next
branch for a pre-release version :) It is not really ready for use yet but it is coming