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

fails to compile without runtime #463

Open
dvc94ch opened this issue Dec 24, 2023 · 3 comments
Open

fails to compile without runtime #463

dvc94ch opened this issue Dec 24, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@dvc94ch
Copy link

dvc94ch commented Dec 24, 2023

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 dvc94ch added the bug Something isn't working label Dec 24, 2023
@arlyon
Copy link
Owner

arlyon commented Jan 4, 2024

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.

@cortopy
Copy link

cortopy commented May 25, 2024

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

@arlyon
Copy link
Owner

arlyon commented May 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants