Let's say I have the following:
enum Item {
None,
Table(Table),
...
}
struct Table {
...
}
And let's say I have some table like this:
let t = &mut Table::new();
How would I go about upcasting t from a &mut Table into a &mut Item? If I try to convert directly like this:
let i = &mut Item::Table(t);
I get the error mismatched types expected struct Table, found &mut Table.