Skip to content

Commit

Permalink
Remove unnecessary Send + Sync bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Oct 13, 2024
1 parent e4fd1f5 commit 7a55800
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions eyeball-im/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct ObservableVector<T> {
sender: Sender<BroadcastMessage<T>>,
}

impl<T: Clone + Send + Sync + 'static> ObservableVector<T> {
impl<T: Clone + 'static> ObservableVector<T> {
/// Create a new `ObservableVector`.
///
/// As of the time of writing, this is equivalent to
Expand Down Expand Up @@ -290,7 +290,7 @@ impl<T: Clone + Send + Sync + 'static> ObservableVector<T> {
}
}

impl<T: Clone + Send + Sync + 'static> Default for ObservableVector<T> {
impl<T: Clone + 'static> Default for ObservableVector<T> {
fn default() -> Self {
Self::new()
}
Expand All @@ -315,7 +315,7 @@ impl<T> ops::Deref for ObservableVector<T> {
}
}

impl<T: Clone + Send + Sync + 'static> From<Vector<T>> for ObservableVector<T> {
impl<T: Clone + 'static> From<Vector<T>> for ObservableVector<T> {
fn from(values: Vector<T>) -> Self {
let mut this = Self::new();
this.append(values);
Expand Down
4 changes: 2 additions & 2 deletions eyeball-im/src/vector/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct ObservableVectorEntry<'a, T> {

impl<'a, T> ObservableVectorEntry<'a, T>
where
T: Clone + Send + Sync + 'static,
T: Clone + 'static,
{
pub(super) fn new(inner: &'a mut ObservableVector<T>, index: usize) -> Self {
Self { inner, index: EntryIndex::Owned(index) }
Expand Down Expand Up @@ -115,7 +115,7 @@ pub struct ObservableVectorEntries<'a, T> {

impl<'a, T> ObservableVectorEntries<'a, T>
where
T: Clone + Send + Sync + 'static,
T: Clone + 'static,
{
pub(super) fn new(inner: &'a mut ObservableVector<T>) -> Self {
Self { inner, index: 0 }
Expand Down
10 changes: 4 additions & 6 deletions eyeball-im/src/vector/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct VectorSubscriber<T> {
rx: Receiver<BroadcastMessage<T>>,
}

impl<T: Clone + Send + Sync + 'static> VectorSubscriber<T> {
impl<T: Clone + 'static> VectorSubscriber<T> {
pub(super) fn new(items: Vector<T>, rx: Receiver<BroadcastMessage<T>>) -> Self {
Self { values: items, rx }
}
Expand Down Expand Up @@ -99,7 +99,7 @@ enum VectorSubscriberStreamState<T> {
// Not clear why this explicit impl is needed, but it's not unsafe so it is fine
impl<T> Unpin for VectorSubscriberStreamState<T> {}

impl<T: Clone + Send + Sync + 'static> Stream for VectorSubscriberStream<T> {
impl<T: Clone + 'static> Stream for VectorSubscriberStream<T> {
type Item = VectorDiff<T>;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand Down Expand Up @@ -170,7 +170,7 @@ impl<T> VectorSubscriberBatchedStream<T> {
}
}

impl<T: Clone + Send + Sync + 'static> Stream for VectorSubscriberBatchedStream<T> {
impl<T: Clone + 'static> Stream for VectorSubscriberBatchedStream<T> {
type Item = Vec<VectorDiff<T>>;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand Down Expand Up @@ -212,9 +212,7 @@ impl<T: Clone + Send + Sync + 'static> Stream for VectorSubscriberBatchedStream<
}
}

fn handle_lag<T: Clone + Send + Sync + 'static>(
rx: &mut Receiver<BroadcastMessage<T>>,
) -> Option<Vector<T>> {
fn handle_lag<T: Clone + 'static>(rx: &mut Receiver<BroadcastMessage<T>>) -> Option<Vector<T>> {
let mut msg = None;
loop {
match rx.try_recv() {
Expand Down
6 changes: 3 additions & 3 deletions eyeball-im/src/vector/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct ObservableVectorTransaction<'o, T: Clone> {
batch: Vec<VectorDiff<T>>,
}

impl<'o, T: Clone + Send + Sync + 'static> ObservableVectorTransaction<'o, T> {
impl<'o, T: Clone + 'static> ObservableVectorTransaction<'o, T> {
pub(super) fn new(inner: &'o mut ObservableVector<T>) -> Self {
let values = inner.values.clone();
Self { inner, values, batch: Vec::new() }
Expand Down Expand Up @@ -316,7 +316,7 @@ pub struct ObservableVectorTransactionEntry<'a, 'o, T: Clone> {

impl<'a, 'o, T> ObservableVectorTransactionEntry<'a, 'o, T>
where
T: Clone + Send + Sync + 'static,
T: Clone + 'static,
{
pub(super) fn new(inner: &'a mut ObservableVectorTransaction<'o, T>, index: usize) -> Self {
Self { inner, index: EntryIndex::Owned(index) }
Expand Down Expand Up @@ -397,7 +397,7 @@ pub struct ObservableVectorTransactionEntries<'a, 'o, T: Clone> {

impl<'a, 'o, T> ObservableVectorTransactionEntries<'a, 'o, T>
where
T: Clone + Send + Sync + 'static,
T: Clone + 'static,
{
pub(super) fn new(inner: &'a mut ObservableVectorTransaction<'o, T>) -> Self {
Self { inner, index: 0 }
Expand Down

0 comments on commit 7a55800

Please sign in to comment.