ladies and gents, the rare self-referential rust type. Did not know Self syntax was supported on the type declaration.
1
ladies and gents, the rare self-referential rust type. Did not know Self syntax was supported on the type declaration.
@senesens In both Vec and Box it's fine because both are pointers to the heap. Without them, the compiler would attempt to inline the struct into itself (which wouldn't work), but through this indirection it's okay. The Vec also allows the list to be empty, otherwise you wouldn't be able to create an object without already having an object (causing a chicken-egg problem).