Skip to content

Commit

Permalink
impl Deref for set::Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 13, 2021
1 parent 4a21fc3 commit 10fce05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crossbeam-skiplist/src/set.rs
Expand Up @@ -3,6 +3,7 @@
use std::borrow::Borrow;
use std::fmt;
use std::iter::FromIterator;
use std::ops::Deref;
use std::ops::{Bound, RangeBounds};

use crate::map;
Expand Down Expand Up @@ -281,6 +282,14 @@ where
}
}

impl<T> Deref for Entry<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
self.value()
}
}

/// An owning iterator over the entries of a `SkipSet`.
pub struct IntoIter<T> {
inner: map::IntoIter<T, ()>,
Expand Down

0 comments on commit 10fce05

Please sign in to comment.