add this line after vec.clear():
vec.clear()
vec.clear(); + vec = vec.into_iter().map(|_| unreachable!()).collect();
UPDATE:
since this was selected as the answer, you can read previous threads on the same topic for detailed explanation, such as: