serialport/serialport-rs

Outdated documentation for TTYPort

Teufelchen1 opened this issue · 2 comments

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");`

/// 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()`.

Good catch. Thank you! Would you mind opening a PR to iron this out?

Can do!