Skip to content

nightly: refactor(generate)!: shrink error payloads to `Box<str>`

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Oct 10:30
Error types are returned by value through every `Result` in the crate,
so their size is paid on the success path too. Replace owned `String`
payloads with `Box<str>` throughout, along with `Vec<String>` ->
`Box<[Box<str>]>`.

    - `GenerateError`:          96 -> 56
    - `ParseTableBuilderError`: 96 -> 24
    - `PrepareGrammarError`:    64 -> 48
    - `LoadGrammarError`:       72 -> 56

Walltime stays mostly flat, peak rss reduces marginally.

BREAKING CHANGE: public error types change for the generate crate