Skip to content

Commit

Permalink
Bump serial2 to version 0.2.28.
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Nov 10, 2024
1 parent c3f57a4 commit a2e5f1e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Unreleased
- [fix][minor] Fix verification of applied settings on iOS and macOS.
- [fix][minor] Allow for a 2.5% deviation in actual baud rate when applying settings on Unix.
- [add][minor] Implement `Debug` for `SerialPort` showing the underlying file descriptor (Unix) or handle (Windows).

# Version 0.1.13 - 2024-06-21
- [add][minor] Support more custom baud rates on iOS and macOS.

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ serde = ["serial2/serde"]
doc = ["tokio/io-util", "serial2/doc"]

[dependencies]
serial2 = "0.2.26"
serial2 = "0.2.28"
tokio = { version = "1.32.0", default-features = false, features = ["net"] }

[target.'cfg(unix)'.dependencies]
Expand Down
7 changes: 7 additions & 0 deletions src/inner/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,10 @@ fn check_ret(value: isize) -> std::io::Result<usize> {
Ok(value as usize)
}
}

impl std::fmt::Debug for SerialPort {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Debug::fmt(&self.io.get_ref(), f)
}
}
9 changes: 9 additions & 0 deletions src/inner/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,12 @@ impl SerialPort {
Poll::Ready(Err(std::io::Error::from_raw_os_error(error as i32)))
}
}

impl std::fmt::Debug for SerialPort {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.with_raw(|serial_port| {
std::fmt::Debug::fmt(serial_port, f)
})
}
}
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,10 @@ impl AsyncWrite for SerialPort {
self.get_mut().inner.poll_shutdown(cx)
}
}

impl std::fmt::Debug for SerialPort {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Debug::fmt(&self.inner, f)
}
}

0 comments on commit a2e5f1e

Please sign in to comment.