Skip to content

Commit 54b94fa

Browse files
Add comment for future EnvTestConfig API privatization (#1752)
### What Add a comment to `EnvTestConfig` noting that the next time a field is added, which requires a breaking change, the fields should be made private and settable via builder-style functions. ### Why `EnvTestConfig` has public fields, which makes adding new fields a breaking change due to struct literal construction and exhaustive pattern matching. The refactor is deferred to the next unavoidable breaking change to avoid introducing one unnecessarily, and the comment ensures the opportunity is not missed. Close #1419
1 parent dcbea44 commit 54b94fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

soroban-sdk/src/env.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ pub struct EnvTestConfig {
270270
/// JSON file to be written to disk when the Env is no longer referenced.
271271
/// Defaults to true.
272272
pub capture_snapshot_at_drop: bool,
273+
// NOTE: Next time a field needs to be added to EnvTestConfig it will be a breaking change,
274+
// take the opportunity to make the current field private, new fields private, and settable via
275+
// functions. Why: So that it is the last time a breaking change is needed to the type.
273276
}
274277

275278
#[cfg(any(test, feature = "testutils"))]

0 commit comments

Comments
 (0)