aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustav Toft <[email protected]>2024-04-11 08:29:06 +0200
committerGustav Toft <[email protected]>2024-04-11 08:29:06 +0200
commitec0896037ad6c48d527e1abb88ca49ec0f376663 (patch)
tree2e7542fa6833c5c9b9ce7cfe0073d5b2fbecc174
parentd4ba6ccc3787624fbc5eee30b6d5c5361ee6e280 (diff)
Removed Result for send and poll_send.
-rw-r--r--embassy-net/src/raw.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-net/src/raw.rs b/embassy-net/src/raw.rs
index ad8d69853..a6500a51f 100644
--- a/embassy-net/src/raw.rs
+++ b/embassy-net/src/raw.rs
@@ -91,7 +91,7 @@ impl<'a> RawSocket<'a> {
91 /// Send a datagram. 91 /// Send a datagram.
92 /// 92 ///
93 /// This method will wait until the datagram has been sent.` 93 /// This method will wait until the datagram has been sent.`
94 pub async fn send<T>(&self, buf: &[u8]) -> Result<(), raw::SendError> { 94 pub async fn send<T>(&self, buf: &[u8]) {
95 poll_fn(move |cx| self.poll_send(buf, cx)).await 95 poll_fn(move |cx| self.poll_send(buf, cx)).await
96 } 96 }
97 97
@@ -101,10 +101,10 @@ impl<'a> RawSocket<'a> {
101 /// 101 ///
102 /// When the socket's send buffer is full, this method will return `Poll::Pending` 102 /// When the socket's send buffer is full, this method will return `Poll::Pending`
103 /// and register the current task to be notified when the buffer has space available. 103 /// and register the current task to be notified when the buffer has space available.
104 pub fn poll_send(&self, buf: &[u8], cx: &mut Context<'_>) -> Poll<Result<(), raw::SendError>> { 104 pub fn poll_send(&self, buf: &[u8], cx: &mut Context<'_>) -> Poll<()> {
105 self.with_mut(|s, _| match s.send_slice(buf) { 105 self.with_mut(|s, _| match s.send_slice(buf) {
106 // Entire datagram has been sent 106 // Entire datagram has been sent
107 Ok(()) => Poll::Ready(Ok(())), 107 Ok(()) => Poll::Ready(()),
108 Err(raw::SendError::BufferFull) => { 108 Err(raw::SendError::BufferFull) => {
109 s.register_send_waker(cx.waker()); 109 s.register_send_waker(cx.waker());
110 Poll::Pending 110 Poll::Pending