Skip to content

Commit 5cb2f2e

Browse files
committed
review feedback: fn iter() + impl Extend, other fixes.
1 parent fda7369 commit 5cb2f2e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

text/3430-unix-socket-ancillary-data-v2.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn send_file(stream: &UnixStream, file: std::fs::File) -> std::io::Result<()> {
103103

104104
MessageSender::new(stream, b"\x00")
105105
.ancillary_data(&mut ancillary)
106-
.send(&stream)?;
106+
.send()?;
107107
Ok(())
108108
}
109109
```
@@ -121,7 +121,7 @@ fn recv_file(stream: &UnixStream) -> std::io::Result<std::fs::File> {
121121
let mut buf = [0u8; 1];
122122
MessageReceiver::new(stream, &mut buf)
123123
.ancillary_data(&mut ancillary)
124-
.recv(&stream)?;
124+
.recv()?;
125125

126126
// TODO: error handling (std::io::Error if not enough FDs returned)
127127
let mut owned_fds = ancillary.take_owned_fds().unwrap();
@@ -172,6 +172,7 @@ impl ControlMessages {
172172
fn as_bytes(&self) -> &[u8];
173173
fn is_empty(&self) -> bool;
174174
fn len(&self) -> usize;
175+
fn iter(&self) -> ControlMessagesIter<'_>;
175176
}
176177

177178
impl<'a> IntoIterator for &'a ControlMessages {
@@ -230,6 +231,8 @@ impl<'a> IntoIterator for &'a ControlMessagesBuf {
230231
type Item = ControlMessage<'a>;
231232
type IntoIter = ControlMessagesIter<'a>;
232233
}
234+
235+
impl Extend<ControlMessage<'_>> for ControlMessagesBuf;
233236
```
234237

235238
## Ancillary data

0 commit comments

Comments
 (0)