Skip to content

Commit

Permalink
added skip_serializing_if for HashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
calbaker committed Dec 18, 2024
1 parent 053b1af commit 1e4c20a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/altrios-core/src/track/link/link_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct Link {
/// Spatial vector of compass heading values and corresponding positions along track
pub headings: Vec<Heading>,
/// Map of train types and corresponding speed sets
#[serde(default)]
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
pub speed_sets: HashMap<TrainType, SpeedSet>,
/// Optional train-type-neutral [SpeedSet]. If provided, overrides [Link::speed_sets].
pub speed_set: Option<SpeedSet>,
Expand Down

0 comments on commit 1e4c20a

Please sign in to comment.