Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug representation of opaque structs #671

Closed
dtolnay opened this Issue Aug 18, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@dtolnay
Copy link

dtolnay commented Aug 18, 2017

Currently the handling of opaque structs is inconsistent.

My preference is the one Registration uses, which is the most similar to what #[derive(Debug)] would do.


mio/src/poll.rs

Lines 1140 to 1144 in f1c59af

impl fmt::Debug for Poll {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "Poll")
}
}

mio/src/poll.rs

Lines 1525 to 1530 in f1c59af

impl fmt::Debug for Registration {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("Registration")
.finish()
}
}

mio/src/sys/windows/tcp.rs

Lines 587 to 591 in f1c59af

impl fmt::Debug for TcpStream {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
"TcpStream { ... }".fmt(f)
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.