Selfworld is a Box containing a World Struct from Bevy
Borrowed Data Escapes Outside of Function Error
Background
A user is attempting to implement a binary tree where the node data is kept separate. After reading various threads on similar issues, they encountered a "borrowed data escapes outside of function" error.
Problem
After calling function f
, the vector b
borrows from vector a
instead of containing a reference to a
. The compiler flags an error when Selfworld
is assigned to a box containing a World
struct from Bevy ECS.
Solution
The user has successfully worked around the issue. However, the error message "borrowed data escapes outside of function" is misleading because it does not specify the actual source of the error.
تعليقات