Skip to content

Commit

Permalink
Got trolled by bounds and CI, this whole thing will be squashed anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed May 29, 2024
1 parent 0422178 commit 7a63bd7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,15 @@ impl<'a, T: Sized + AsRef<[u8]> + Send + Sync + 'a> From<Arc<T>> for Bytes<'a> {
}
}
}
#[cfg(feature = "alloc")]
unsafe impl<'a> Send for Bytes<'a>
where
&'a [u8]: Send,
Arc<[u8]>: Send,
Arc<dyn 'a + AsRef<[u8]> + Send + Sync>: Send,
{
}
#[cfg(feature = "alloc")]
unsafe impl<'a> Sync for Bytes<'a>
where
&'a [u8]: Send,
Expand All @@ -279,6 +281,11 @@ where
{
}

#[cfg(not(feature = "alloc"))]
unsafe impl<'a> Send for Bytes<'a> where &'a [u8]: Send {}
#[cfg(not(feature = "alloc"))]
unsafe impl<'a> Sync for Bytes<'a> where &'a [u8]: Send {}

#[derive_ReprC]
#[repr(C)]
#[derive(Debug, Clone, Copy)]
Expand Down

0 comments on commit 7a63bd7

Please sign in to comment.