pub fn insert_if_absent(&mut self, value: T) -> bool {
        if !self.map.contains_key(&value) {
            self.map.insert(value, ()).is_none()
        } else {
            false
        }
    }
/// Adds a value to the set, if not already present. The distinction with `insert` is that
/// order of elements is unaffected when calling this method for a value already contained.
///
/// If the set did not have this value present, `true` is returned.
///
/// If the set did have this value present, `false` is returned.
///
/// # Examples
///
/// ```
/// use linked_hash_set::LinkedHashSet;
///
/// let mut set = LinkedHashSet::new();
///
/// assert_eq!(set.insert_if_absent(2), true);
/// assert_eq!(set.insert_if_absent(2), false);
/// assert_eq!(set.len(), 1);
/// ```
Adds a value to the set, if not already present. The distinction with `insert` is that
order of elements is unaffected when calling this method for a value already contained.

If the set did not have this value present, `true` is returned.

If the set did have this value present, `false` is returned.
Adds a value to the set if not already present . The distinction with ` insert ` is that order of elements is unaffected when calling this method for a value already contained . If the set did not have this value present ` true ` is returned . If the set did have this value present ` false ` is returned .
pub fn insert_if_absent(&mut self, value: T) -> bool {
        if !self.map.contains_key(&value) {
            self.map.insert(value, ()).is_none()
        } else {
            false
        }
    }
pub fn insert_if_absent ( & mut self , value : T ) -> bool { if ! self . map . contains_key ( & value ) { self . map . insert ( value , ( ) ) . is_none ( ) } else { false } }
Adds a value to the set, if not already present.
Adds a value to the set if not already present .
&mut self
value
T
&mut self
value
T
examples
```
use linked_hash_set::LinkedHashSet.

let mut set = LinkedHashSet::new().


` ` ` use linked_hash_set :: LinkedHashSet . let mut set = LinkedHashSet :: new () .