4 ms·
(Not sure if this is the official explanation, but makes sense to me) The issue is that you have references to the String (it's borrowed). That means it can't
by danhor 5y ago
(Not sure if this is the official explanation, but makes sense to me)
The issue is that you have references to the String (it's borrowed). That means it can't change, which isn't/can't be expressed in this struct. Imagine clearing the String: Suddenly all references in words are invalid which means you're referencing something invalid, very much not memory safe and a big rust no-go