Skip to content

Commit 7dcdd69

Browse files
committed
Add entry_insex to set.rs
1 parent 29819a2 commit 7dcdd69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/set.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,14 @@ where
327327
self.map.get_full(value).map(|(i, x, &())| (i, x))
328328
}
329329

330+
/// Return item index
331+
pub fn entry_index<Q: ?Sized>(&self, value: &Q) -> Option<(usize)>
332+
where
333+
Q: Hash + Equivalent<T>,
334+
{
335+
self.map.entry_index(value)
336+
}
337+
330338
/// Adds a value to the set, replacing the existing value, if any, that is
331339
/// equal to the given one. Returns the replaced value.
332340
///

0 commit comments

Comments
 (0)