Skip to content

simplify display of RulesFor variants - #660

Merged
NSoiffer merged 1 commit into
daisy:mainfrom
moritz-gross:simplify-Display-of-RulesFor-variants
Aug 11, 2026
Merged

simplify display of RulesFor variants#660
NSoiffer merged 1 commit into
daisy:mainfrom
moritz-gross:simplify-Display-of-RulesFor-variants

Conversation

@moritz-gross

Copy link
Copy Markdown
Collaborator

a small simplification using the strum crate that we already have.

@NSoiffer

Copy link
Copy Markdown
Collaborator

Looks good. I'm surprised that there aren't other places that can take advantage of that macros (or that it is not built-in).

@NSoiffer
NSoiffer merged commit d1a3927 into daisy:main Aug 11, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in MathCAT Project Board Aug 11, 2026
@moritz-gross

Copy link
Copy Markdown
Collaborator Author

Looks good. I'm surprised that there aren't other places that can take advantage of that macros (or that it is not built-in).

there are multiple places that are close this, but not exactly fitting.

For example fmt of Token in infer_intent.rs is a close candidate, but we have the special case of
Token::ConceptOrLiteral(str) => format!("Literal({str})"),, which breaks the clean variant-based formatting.

Another case is "sapi5" for TTS::SAPI5 in prefs.rs, which switches from upper- to lowercase.

I could just make PRs based on what looks the cleanest and most consistent to me and then you can judge if it should be changed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Coding in Rust

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants