Repository: serialport/serialport-rs (language: rust)

Issue:
Outdated documentation for TTYPort
Hello!

I got confused by this comment and spend unnecessary time figuring out what I am doing wrong.
My suggestion is to change the documentation to:
```
However, this struct should not be instantiated directly by using TTYPort::open(),
instead use the cross-platform serialport::new(). Example:
`let mut port = serialport::new("/dev/ttyS0", 115200).open().expect("Error");`
```
https://github.com/serialport/serialport-rs/blob/09bfb98b00a86d2e4a53d4758f4e91f503b07044/src/posix/tty.rs#L36-L39


Discussion / hints:
Good catch. Thank you! Would you mind opening a PR to iron this out?
Can do!

Fix patch:
diff --git a/src/posix/tty.rs b/src/posix/tty.rs
index 968c936b..b1d68cff 100644
--- a/src/posix/tty.rs
+++ b/src/posix/tty.rs
@@ -33,10 +33,14 @@ fn close(fd: RawFd) {
 
 /// A serial port implementation for POSIX TTY ports
 ///
-/// The port will be closed when the value is dropped. However, this struct
-/// should not be instantiated directly by using `TTYPort::open()`, instead use
-/// the cross-platform `serialport::open()` or
-/// `serialport::open_with_settings()`.
+/// The port will be closed when the value is dropped. This struct
+/// should not be instantiated directly by using `TTYPort::open()`.
+/// Instead, use the cross-platform `serialport::new()`. Example:
+///
+/// ```no_run
+/// let mut port = serialport::new("/dev/ttyS0", 115200).open().expect("Unable to open");
+/// # let _ = &mut port;
+/// ```
 ///
 /// Note: on macOS, when connecting to a pseudo-terminal (`pty` opened via
 /// `posix_openpt`), the `baud_rate` should be set to 0; this will be used to
@@ -47,14 +51,10 @@ fn close(fd: RawFd) {
 /// use serialport::{TTYPort, SerialPort};
 ///
 /// let (mut master, mut slave) = TTYPort::pair().expect("Unable to create ptty pair");
-///
 /// # let _ = &mut master;
 /// # let _ = &mut slave;
-///
 /// // ... elsewhere
-///
-/// let mut port = TTYPort::open(&serialport::new(slave.name().unwrap(), 0)).expect("unable to open");
-///
+/// let mut port = TTYPort::open(&serialport::new(slave.name().unwrap(), 0)).expect("Unable to open");
 /// # let _ = &mut port;
 /// ```
 #[derive(Debug)]


Test patch: