diff options
| author | Sam Lakerveld <[email protected]> | 2023-08-08 11:22:01 +0200 |
|---|---|---|
| committer | Sam Lakerveld <[email protected]> | 2023-08-08 11:22:01 +0200 |
| commit | 2ab9a07b64d4badb3671ed5065c520ff9bb83038 (patch) | |
| tree | 686aa30c13c67f14e6374140365a3fae1d64ae88 /embassy-sync/src/pipe.rs | |
| parent | 5d5cd2371504915a531e669dce3558485a51a2e1 (diff) | |
embassy-sync: manual Copy impls for channel and pipe
Diffstat (limited to 'embassy-sync/src/pipe.rs')
| -rw-r--r-- | embassy-sync/src/pipe.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/embassy-sync/src/pipe.rs b/embassy-sync/src/pipe.rs index 6e3e77b49..21d451ea6 100644 --- a/embassy-sync/src/pipe.rs +++ b/embassy-sync/src/pipe.rs | |||
| @@ -11,7 +11,6 @@ use crate::ring_buffer::RingBuffer; | |||
| 11 | use crate::waitqueue::WakerRegistration; | 11 | use crate::waitqueue::WakerRegistration; |
| 12 | 12 | ||
| 13 | /// Write-only access to a [`Pipe`]. | 13 | /// Write-only access to a [`Pipe`]. |
| 14 | #[derive(Copy)] | ||
| 15 | pub struct Writer<'p, M, const N: usize> | 14 | pub struct Writer<'p, M, const N: usize> |
| 16 | where | 15 | where |
| 17 | M: RawMutex, | 16 | M: RawMutex, |
| @@ -28,6 +27,8 @@ where | |||
| 28 | } | 27 | } |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 30 | impl<'p, M, const N: usize> Copy for Writer<'p, M, N> where M: RawMutex {} | ||
| 31 | |||
| 31 | impl<'p, M, const N: usize> Writer<'p, M, N> | 32 | impl<'p, M, const N: usize> Writer<'p, M, N> |
| 32 | where | 33 | where |
| 33 | M: RawMutex, | 34 | M: RawMutex, |
| @@ -74,7 +75,6 @@ where | |||
| 74 | impl<'p, M, const N: usize> Unpin for WriteFuture<'p, M, N> where M: RawMutex {} | 75 | impl<'p, M, const N: usize> Unpin for WriteFuture<'p, M, N> where M: RawMutex {} |
| 75 | 76 | ||
| 76 | /// Read-only access to a [`Pipe`]. | 77 | /// Read-only access to a [`Pipe`]. |
| 77 | #[derive(Copy)] | ||
| 78 | pub struct Reader<'p, M, const N: usize> | 78 | pub struct Reader<'p, M, const N: usize> |
| 79 | where | 79 | where |
| 80 | M: RawMutex, | 80 | M: RawMutex, |
| @@ -91,6 +91,8 @@ where | |||
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | impl<'p, M, const N: usize> Copy for Reader<'p, M, N> where M: RawMutex {} | ||
| 95 | |||
| 94 | impl<'p, M, const N: usize> Reader<'p, M, N> | 96 | impl<'p, M, const N: usize> Reader<'p, M, N> |
| 95 | where | 97 | where |
| 96 | M: RawMutex, | 98 | M: RawMutex, |
