iter: Keys<'a, T, ()>,
}
+#[stable(feature = "collection_debug", since = "1.17.0")]
+impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_tuple("Iter")
+ .field(&self.iter.clone())
+ .finish()
+ }
+}
+
/// An owning iterator over a `BTreeSet`'s items.
///
/// This structure is created by the `into_iter` method on [`BTreeSet`]
///
/// [`BTreeSet`]: struct.BTreeSet.html
#[stable(feature = "rust1", since = "1.0.0")]
+#[derive(Debug)]
pub struct IntoIter<T> {
iter: ::btree_map::IntoIter<T, ()>,
}
///
/// [`BTreeSet`]: struct.BTreeSet.html
/// [`range`]: struct.BTreeSet.html#method.range
+#[derive(Debug)]
+#[stable(feature = "btree_range", since = "1.17.0")]
pub struct Range<'a, T: 'a> {
iter: ::btree_map::Range<'a, T, ()>,
}
b: Peekable<Iter<'a, T>>,
}
+#[stable(feature = "collection_debug", since = "1.17.0")]
+impl<'a, T: 'a + fmt::Debug> fmt::Debug for Difference<'a, T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_tuple("Difference")
+ .field(&self.clone())
+ .finish()
+ }
+}
+
/// A lazy iterator producing elements in the set symmetric difference (in-order).
///
/// This structure is created by the [`symmetric_difference`] method on
b: Peekable<Iter<'a, T>>,
}
+#[stable(feature = "collection_debug", since = "1.17.0")]
+impl<'a, T: 'a + fmt::Debug> fmt::Debug for SymmetricDifference<'a, T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_tuple("SymmetricDifference")
+ .field(&self.clone())
+ .finish()
+ }
+}
+
/// A lazy iterator producing elements in the set intersection (in-order).
///
/// This structure is created by the [`intersection`] method on [`BTreeSet`].
b: Peekable<Iter<'a, T>>,
}
+#[stable(feature = "collection_debug", since = "1.17.0")]
+impl<'a, T: 'a + fmt::Debug> fmt::Debug for Intersection<'a, T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_tuple("Intersection")
+ .field(&self.clone())
+ .finish()
+ }
+}
+
/// A lazy iterator producing elements in the set union (in-order).
///
/// This structure is created by the [`union`] method on [`BTreeSet`].
b: Peekable<Iter<'a, T>>,
}
+#[stable(feature = "collection_debug", since = "1.17.0")]
+impl<'a, T: 'a + fmt::Debug> fmt::Debug for Union<'a, T> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.debug_tuple("Union")
+ .field(&self.clone())
+ .finish()
+ }
+}
+
impl<T: Ord> BTreeSet<T> {
/// Makes a new `BTreeSet` with a reasonable choice of B.
///
/// # Examples
///
/// ```
- /// #![feature(btree_range, collections_bound)]
- ///
/// use std::collections::BTreeSet;
/// use std::collections::Bound::Included;
///
/// }
/// assert_eq!(Some(&5), set.range(4..).next());
/// ```
- #[unstable(feature = "btree_range",
- reason = "matches collection reform specification, waiting for dust to settle",
- issue = "27787")]
+ #[stable(feature = "btree_range", since = "1.17.0")]
pub fn range<K: ?Sized, R>(&self, range: R) -> Range<T>
where K: Ord, T: Borrow<K>, R: RangeArgument<K>
{
}
impl<T: Ord> BTreeSet<T> {
- /// Visits the values representing the difference, in ascending order.
+ /// Visits the values representing the difference,
+ /// i.e. the values that are in `self` but not in `other`,
+ /// in ascending order.
///
/// # Examples
///
}
}
- /// Visits the values representing the symmetric difference, in ascending order.
+ /// Visits the values representing the symmetric difference,
+ /// i.e. the values that are in `self` or in `other` but not in both,
+ /// in ascending order.
///
/// # Examples
///
}
}
- /// Visits the values representing the intersection, in ascending order.
+ /// Visits the values representing the intersection,
+ /// i.e. the values that are both in `self` and `other`,
+ /// in ascending order.
///
/// # Examples
///
}
}
- /// Visits the values representing the union, in ascending order.
+ /// Visits the values representing the union,
+ /// i.e. all the values in `self` or `other`, without duplicates,
+ /// in ascending order.
///
/// # Examples
///
Recover::get(&self.map, value)
}
- /// Returns `true` if the set has no elements in common with `other`.
+ /// Returns `true` if `self` has no elements in common with `other`.
/// This is equivalent to checking for an empty intersection.
///
/// # Examples
self.intersection(other).next().is_none()
}
- /// Returns `true` if the set is a subset of another.
+ /// Returns `true` if the set is a subset of another,
+ /// i.e. `other` contains at least all the values in `self`.
///
/// # Examples
///
true
}
- /// Returns `true` if the set is a superset of another.
+ /// Returns `true` if the set is a superset of another,
+ /// i.e. `self` contains at least all the values in `other`.
///
/// # Examples
///