Conversation
Some APIs, like `nonblock::NonBlockingReader::from_fd` take a value that implements AsRawFd. Pty implements AsRawFd, but if we pass it by value, it will get moved, as it doesn't implement Clone or Copy. With this change, &Pty can now be passed without moving the Pty.
|
this feels a bit odd - other things that implement AsRawFd don't do this, so it feels like it would make more sense to change this on the |
|
I can try opening a pull request on the nonblock repo later today, and see if there are any objections. |
|
Well, I tried to see if I can make a simple change on the nonblock-rs side, but I'm not sure what to do. pub struct NonBlockingReader<R: AsRawFd + Read> {
eof: bool,
reader: R,
}I'm not sure how to make that work with references. |
Some APIs, like
nonblock::NonBlockingReader::from_fdtake a value that implements AsRawFd.Pty implements AsRawFd, but if we pass it by value, it will get moved, as it doesn't implement Clone or Copy.
With this change, &Pty can now be passed without moving the Pty.