Rust Copy on Cast
Eric Opines
24
The reason that it’s common for Enums to be Copy is that they only take up one machine word. So it’s just as expensive (in terms of space) to store a pointer to one as it is to store one directly.
For your function, it doesn’t really make sense to worry about trying to avoid an “allocation”, since it’s really just going to be returning one machine word on the stack, and not invoking malloc or anything.