Skip to content

Commit

Permalink
Very relevant warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheme committed Mar 1, 2021
1 parent d0c4741 commit aa92ade
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trie-db/src/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ impl<'a, L: TrieLayout> TrieDBNodeIterator<'a, L> {

/// Advance the iterator into a prefix, no value out of the prefix will be accessed
/// or returned after this operation.
/// Warning prefix iterator may embed non prefix node when there is inline nodes.
pub fn prefix(&mut self, prefix: &[u8]) -> Result<(), TrieHash<L>, CError<L>> {
if self.seek_prefix(prefix)? {
if let Some(v) = self.trail.pop() {
Expand All @@ -246,6 +247,7 @@ impl<'a, L: TrieLayout> TrieDBNodeIterator<'a, L> {

/// Advance the iterator into a prefix, no value out of the prefix will be accessed
/// or returned after this operation.
/// Warning prefix iterator may embed non prefix node when there is inline nodes.
pub fn prefix_then_seek(&mut self, prefix: &[u8], seek: &[u8]) -> Result<(), TrieHash<L>, CError<L>> {
if seek.starts_with(prefix) {
if self.seek_prefix(seek)? {
Expand Down

0 comments on commit aa92ade

Please sign in to comment.