Closed jessegrosjean closed 1 month ago
Quite possibly there's a simple way using existing API, but I couldn't figure it out. In the meantime I've created this pull request that adds the API that I really wanted in the first place: https://github.com/programble/ego-tree/pull/15
I'd like to insert a child into a NodeMut at a specified index. Seems like it should be easy, but I can't figure it out. Keep running into lifetime problems.
My non-working code is:
The logic (for now) is to insert before child node at given index if child node exists, otherwise insert at end. In final API it probably makes more sense to throw error if index is beyond count, but I'm trying to keep example code simple as possible at moment.
Any tips on how to get this working?