async-stripe icon indicating copy to clipboard operation
async-stripe copied to clipboard

fails to compile without runtime

Open dvc94ch opened this issue 1 year ago • 3 comments

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

dvc94ch avatar Dec 24 '23 16:12 dvc94ch

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.

arlyon avatar Jan 04 '24 13:01 arlyon

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

cortopy avatar May 25 '24 22:05 cortopy

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

arlyon avatar May 29 '24 15:05 arlyon