Tweak insert docs
This commit is contained in:
parent
02916c4c75
commit
b02146a370
@ -126,9 +126,10 @@ pub fn get(&self, value: &T) -> Option<&T> {
|
||||
|
||||
/// Adds a value to the set.
|
||||
///
|
||||
/// If the set did not have this value present, `true` is returned.
|
||||
/// Returns whether the value was newly inserted. That is:
|
||||
///
|
||||
/// If the set did have this value present, `false` is returned.
|
||||
/// - If the set did not previously contain this value, `true` is returned.
|
||||
/// - If the set already contained this value, `false` is returned.
|
||||
#[inline]
|
||||
pub fn insert(&mut self, elem: T) -> bool {
|
||||
self.map.insert(elem, ()).is_none()
|
||||
|
@ -770,10 +770,14 @@ pub fn pop_last(&mut self) -> Option<T>
|
||||
|
||||
/// Adds a value to the set.
|
||||
///
|
||||
/// If the set did not have an equal element present, `true` is returned.
|
||||
/// Returns whether the value was newly inserted. That is:
|
||||
///
|
||||
/// If the set did have an equal element present, `false` is returned, and
|
||||
/// the entry is not updated. See the [module-level documentation] for more.
|
||||
/// - If the set did not previously contain an equal value, `true` is
|
||||
/// returned.
|
||||
/// - If the set already contained an equal value, `false` is returned, and
|
||||
/// the entry is not updated.
|
||||
///
|
||||
/// See the [module-level documentation] for more.
|
||||
///
|
||||
/// [module-level documentation]: index.html#insert-and-complex-keys
|
||||
///
|
||||
|
@ -858,9 +858,10 @@ pub fn is_superset(&self, other: &HashSet<T, S>) -> bool {
|
||||
|
||||
/// Adds a value to the set.
|
||||
///
|
||||
/// If the set did not have this value present, `true` is returned.
|
||||
/// Returns whether the value was newly inserted. That is:
|
||||
///
|
||||
/// If the set did have this value present, `false` is returned.
|
||||
/// - If the set did not previously contain this value, `true` is returned.
|
||||
/// - If the set already contained this value, `false` is returned.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user