Skip to content

Commit

Permalink
Document the return value of IndexMapCore::push
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jun 25, 2020
1 parent db5be09 commit 3c95c02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rayon = { version = "1.0", optional = true }
[dependencies.hashbrown]
version = "0.8"
default-features = false
features = ["inline-more", "raw"]
features = ["raw"]

[dev-dependencies]
itertools = "0.9"
Expand Down
3 changes: 2 additions & 1 deletion src/map_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ impl<K, V> IndexMapCore<K, V> {
}
}

/// Append a key-value pair, *without* checking whether it already exists.
/// Append a key-value pair, *without* checking whether it already exists,
/// and return the pair's new index.
fn push(&mut self, hash: HashValue, key: K, value: V) -> usize {
let i = self.entries.len();
self.indices.insert(hash.get(), i, get_hash(&self.entries));
Expand Down

0 comments on commit 3c95c02

Please sign in to comment.