Invalid return … The local variable ‘Option’ might still contain a value. The value does not have the ‘drop’ ability and must be consumed before the function returns
Move compiler failed…
How can I destroy / delete an option, whose name is weaponOption
?
if(option::is_some(&weaponOption)) {
let weapon = option::extract(&mut weaponOption);
//let Weapon { id, damage: _} = weapon; object::delete(id);
transfer::transfer(weapon, sender);
} else {
option::destroy_none(weaponOption);
};