Skip to content

Commit

Permalink
Merge pull request #44 from embassy-rs/fix-close
Browse files Browse the repository at this point in the history
fix channel close
  • Loading branch information
lulf authored May 21, 2024
2 parents 75227c3 + a7dc898 commit f4a8947
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions host/src/channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@ pub(crate) struct PacketChannel<const QLEN: usize> {
impl<const QLEN: usize> PacketChannel<QLEN> {
pub(crate) const NEW: PacketChannel<QLEN> = PacketChannel { chan: Channel::new() };

pub fn try_close(&self) -> Result<(), ()> {
pub fn close(&self) -> Result<(), ()> {
self.chan.try_send(None).map_err(|_| ())
}

pub async fn close(&self) {
self.chan.send(None).await;
}

pub async fn send(&self, pdu: Pdu) {
self.chan.send(Some(pdu)).await;
}
Expand Down

0 comments on commit f4a8947

Please sign in to comment.