JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
88 stars 4 forks source link

Err variants should be boxed where relevant #396

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Summary of current issue

Clippy complains that the error variant of ParseResult is very large (and of a few others possibly). This means that the compiler has to reserve a lot of memory each time even if the value is Ok. See here.

Proposed change

Box the error variant.

JSAbrahams commented 1 year ago

TypeErr is already in a vector, so it's on the heap.