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

Make EnvTestConfig internals private and add functions #1419

Open
leighmcculloch opened this issue Dec 17, 2024 · 0 comments
Open

Make EnvTestConfig internals private and add functions #1419

leighmcculloch opened this issue Dec 17, 2024 · 0 comments

Comments

@leighmcculloch
Copy link
Member

What problem does your feature solve?

The EnvTestConfig type contains feature flags that can be enabled/disabled to control how the test Env behaves. Because the type has a list of pub fields it's not possible to add new fields to the config between major versions, because that would break pattern matching of the type, and value creation that requires all fields to be specified.

What would you like to see?

Make EnvTestConfig internals private and add functions.

Suggest the following interface:

Before

let config = EnvTestConfig { capture_snapshot_at_drop: false };
let env = Env::new_with_config(config);

After

let config = EnvTestConfig::default()
    .set_capture_snapshot_at_drop(false);
let env = Env::new_with_config(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant