Skip to content

(wip): keyed patching for store fields#4544

Open
gbj wants to merge 17 commits intomainfrom
keyed-patch
Open

(wip): keyed patching for store fields#4544
gbj wants to merge 17 commits intomainfrom
keyed-patch

Conversation

@gbj
Copy link
Collaborator

@gbj gbj commented Jan 18, 2026

This builds on top of #4473 to support better patching for keyed store fields. Currently, .patch() works on Vec<_> fields but does an unkeyed list diff: i.e., if you patch vec![0, 1, 2] against vec![2, 1, 0], it will act as if 0 and 2 have both changed values, rather than simply noting that they've been reordered.

This PR adds proper patching for keyed fields by using their key function. Currently it only does this for Vec<_> but this can easily be extended to add support for map types (which are easier) or other collections by implementing the PatchFieldKeyed trait on the collection type.

TiemenSch and others added 17 commits January 3, 2026 07:32
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Signed-off-by: Tiemen Schuijbroek <t.j.l.schuijbroek@ratio-case.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants