Skip to content

Move enum fields into structs#1145

Open
adamchalmers wants to merge 1 commit intomainfrom
achalmers/builder-api-refs
Open

Move enum fields into structs#1145
adamchalmers wants to merge 1 commit intomainfrom
achalmers/builder-api-refs

Conversation

@adamchalmers
Copy link
Copy Markdown
Collaborator

@adamchalmers adamchalmers commented Mar 30, 2026

This is purely a refactor, I don't expect any behavioural changes.

Purpose of the refactor is: Bon (our builder API macro crate) doesn't work on enums. But some enums have struct-like named fields, making them very close to a struct and therefore having all the same problems, e.g. when you add a field, it'll cause compile errors in the engine, forcing people to handle those new fields.

Solution is to move those enum fields into a new struct, which CAN have the Builder derive on it.

This is going to make the new Face API easier to integrate by causing fewer compile errors. Moving these fields into named structs will be a breaking change, but it's a very easy breaking change, and will reduce future changes.

Also incidentally bump rustls for a security patch.

This is purely a refactor, I don't expect any behavioural changes.

Purpose of the refactor is: Bon (our builder API macro crate) doesn't
work on enums. But some enums have struct-like named fields, making them
very close to a struct and therefore having all the same problems, e.g.
when you add a field, it'll cause compile errors in the engine, forcing
people to handle those new fields.

Solution is to move those enum fields into a new struct, which CAN have
the Builder derive on it.

This is going to make the new Face API easier to integrate by causing
fewer compile errors.

Also incidentally bump rustls
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@44dd2c3). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1145   +/-   ##
=======================================
  Coverage        ?   30.22%           
=======================================
  Files           ?       34           
  Lines           ?     1588           
  Branches        ?        0           
=======================================
  Hits            ?      480           
  Misses          ?     1108           
  Partials        ?        0           
Flag Coverage Δ
unittests 30.22% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@iterion iterion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iiuc this is a breaking change for the Rust types but not for the API itself, and the api.json suggests the same

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