UnionAsMapOptions declares two fields that are never read, in either direction:
pub const UnionAsMapOptions = struct {
key: union(enum) { field_name, field_name_prefix: u8, field_index },
omit_nulls: bool = true,
omit_defaults: bool = false,
};
grep for omit_nulls/omit_defaults in src/union.zig finds only these two declarations. They are copy-paste from StructAsMapOptions, where both are genuinely used by isStructFieldUsed on the encode side.
They are also meaningless here: packUnionAsMap always writes packMapHeader(writer, 1) — exactly one entry, the active variant — so there is nothing to omit.
Same category as the dead surface removed in #27. Two lines, and no behaviour change since nothing reads them.
Noted while adding skip_unknown_fields in #28 and left out to keep that PR focused.
UnionAsMapOptionsdeclares two fields that are never read, in either direction:grepforomit_nulls/omit_defaultsinsrc/union.zigfinds only these two declarations. They are copy-paste fromStructAsMapOptions, where both are genuinely used byisStructFieldUsedon the encode side.They are also meaningless here:
packUnionAsMapalways writespackMapHeader(writer, 1)— exactly one entry, the active variant — so there is nothing to omit.Same category as the dead surface removed in #27. Two lines, and no behaviour change since nothing reads them.
Noted while adding
skip_unknown_fieldsin #28 and left out to keep that PR focused.