Commit 8a94633
Replace per-setting settings-event macro expansion with shared generic registration
The register_settings_events! macro expanded a full registration
function for every setting. Move that body into
settings::registration, where it is generic over only the settings
group and value types, so settings that share those types share one
compiled instantiation. The macro now only builds a SettingCallbacks
struct of function pointers at its expansion site, which keeps the
method resolution of the old expanded code. Emit change events through
the new SettingChangeEvent trait so define_setting! and
implement_setting_for_enum! generate one concat_idents! block per
setting instead of four.
Co-Authored-By: Warp <agent@warp.dev>1 parent dc10778 commit 8a94633
3 files changed
Lines changed: 310 additions & 181 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
640 | 641 | | |
641 | 642 | | |
642 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
643 | 655 | | |
644 | 656 | | |
645 | 657 | | |
| |||
0 commit comments