Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish fixing #17 #78

Merged
merged 15 commits into from
Mar 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions src/set_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,31 @@ where
/// Returns `true` if `self` has no elements in common with `other`.
///
/// See also [`HashSet::is_disjoint`].
pub fn is_disjoint(&self, other: &HashSet<T, S>) -> bool {
self.set.is_disjoint(other, &self.guard)
pub fn is_disjoint<Q>(&self, other: &Q) -> bool
where
Q: AsRef<HashSet<T, S>>,
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
{
self.set.is_disjoint(other.as_ref(), &self.guard)
}

/// Returns `true` if the set is a subset of another, i.e., `other` contains at least all the values in `self`.
///
/// See also [`HashSet::is_subset`].
pub fn is_subset(&self, other: &HashSet<T, S>) -> bool {
self.set.is_subset(other, &self.guard)
pub fn is_subset<Q>(&self, other: &Q) -> bool
where
Q: AsRef<HashSet<T, S>>,
{
self.set.is_subset(other.as_ref(), &self.guard)
}

/// Returns `true` if the set is a superset of another, i.e., `self` contains at least all the values in `other`.
///
/// See also [`HashSet::is_superset`].
pub fn is_superset(&self, other: &HashSet<T, S>) -> bool {
self.set.is_superset(other, &self.guard)
pub fn is_superset<Q>(&self, other: &Q) -> bool
where
Q: AsRef<HashSet<T, S>>,
{
self.set.is_superset(other.as_ref(), &self.guard)
}
}

Expand Down