You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on #1568 I figured a way to keep optional settings from being included in serialized forms of GithubCiInfo and such.
The gist of it is, when something is dependent on a config setting:
have it be an Option<...>,
use #[serde(skip_serializing_if = "Option::is_none")]
when using the value, use something along the lines of need_thing.then_some(thing)
When adding cargo-auditable, it touched almost every insta snapshot, but by using this approach in #1568 it only touches snapshots enabling the omnibor integration.
This will wind up touching all those snapshots again, but it seems like a good practice to adopt.
When working on #1568 I figured a way to keep optional settings from being included in serialized forms of
GithubCiInfo
and such.The gist of it is, when something is dependent on a config setting:
Option<...>
,#[serde(skip_serializing_if = "Option::is_none")]
need_thing.then_some(thing)
When adding
cargo-auditable
, it touched almost every insta snapshot, but by using this approach in #1568 it only touches snapshots enabling the omnibor integration.This will wind up touching all those snapshots again, but it seems like a good practice to adopt.
cargo-dist/cargo-dist/src/backend/ci/github.rs
Lines 276 to 277 in f915d87
cargo-dist/cargo-dist/src/backend/ci/github.rs
Lines 348 to 349 in f915d87
The text was updated successfully, but these errors were encountered: