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
Currently they return a &T or &mut T just as a Vec or a slice, but similarly, they will panic on accessing an invalid index.
But Vec and slices are contiguous and the validity of an index is highly predictable. In the Trie, seeing it as a sparse form of a Vec, the validity of the index is highly unpredictable, making a panic very probable. This doesn't seem useful.
The accessors get() and get_mut() are much more practical.
unwrap() should be replaced with expect(message) to give clear error messages on panic.
The text was updated successfully, but these errors were encountered:
&T
or&mut T
just as aVec
or a slice, but similarly, they will panic on accessing an invalid index.But
Vec
and slices are contiguous and the validity of an index is highly predictable. In theTrie
, seeing it as a sparse form of aVec
, the validity of the index is highly unpredictable, making a panic very probable. This doesn't seem useful.The accessors
get()
andget_mut()
are much more practical.unwrap()
should be replaced withexpect(message)
to give clear error messages on panic.The text was updated successfully, but these errors were encountered: