You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a HighlightState with a cached initial_stack, as described in the docs:
Alternatively you can save space by caching only the path field of this struct
then re-create the HighlightState when needed by passing that stack as the initial_stack
parameter to the new method. This takes less space but a small amount of time to re-create the style stack.
I'm probably missing something (very new to rust), but to me it appears this is guaranteed to crash:
The first call to update_single_cache_for_push in HighlightState::new, will pass path of length 0, which results in path.len() - 1 panicking with attempt to subtract with overflow.
Is there an example somewhere of code using HighlightState with a non-empty initial_stack? What am I missing?
Thanks ahead, and many thanks for building this incredible library!
The text was updated successfully, but these errors were encountered:
Hi, thanks for reporting. It's possible that there are currently no unit tests covering this scenario, and that you are the first person to try using it...
I will investigate when I'm able to make time, but maybe someone else will beat me to it :)
Hi,
I'm trying to build a
HighlightState
with a cachedinitial_stack
, as described in the docs:I'm probably missing something (very new to rust), but to me it appears this is guaranteed to crash:
The first call to
update_single_cache_for_push
inHighlightState::new
, will passpath
of length 0, which results inpath.len() - 1
panicking withattempt to subtract with overflow
.Is there an example somewhere of code using HighlightState with a non-empty initial_stack? What am I missing?
Thanks ahead, and many thanks for building this incredible library!
The text was updated successfully, but these errors were encountered: