diff --git a/src/backend/mod.rs b/src/backend/mod.rs index b44ad647b5..37b6603b99 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -99,7 +99,7 @@ pub struct VersionInfo { pub release_url: Option, /// If true, this is a rolling release (like "nightly") that should always /// be considered potentially outdated for `mise up` purposes - #[serde(default)] + #[serde(default, skip_serializing_if = "is_false")] pub rolling: bool, /// Checksum of the release asset, used to detect changes in rolling releases #[serde(skip_serializing_if = "Option::is_none", default)] @@ -108,10 +108,14 @@ pub struct VersionInfo { /// reliable signal (e.g. GitHub releases' `prerelease: true`) populate this /// so the shared remote-versions cache can store the superset and apply the /// `prerelease` tool option as a read-time filter. - #[serde(default)] + #[serde(default, skip_serializing_if = "is_false")] pub prerelease: bool, } +fn is_false(v: &bool) -> bool { + !v +} + impl VersionInfo { /// Filter versions to only include those released before the given timestamp. /// Versions without a created_at timestamp are included by default.