How to cleanup object after being borrow_mut ?? #431
Answered
by
MoonShiesty
ajaythxkur
asked this question in
Questions
-
i want to delete object on a specific if condition:
I can't delete the object with object.delete_ref |
Beta Was this translation helpful? Give feedback.
Answered by
MoonShiesty
Sep 16, 2024
Replies: 1 comment 5 replies
-
you need to remove all the resources inside of the object before you can destroy it, ie:
then you can cleanup the object with the delete ref. if the delete ref is stored in the resource you can do this:
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you should be able to borrow within a local scope:
ie: