sdroege/async-tungstenite

async_tungstenite::tokio::ConnectStream doesn't implement Debug when feature "tokio-native-tls" is enabled.

hn-sl opened this issue · 5 comments

hn-sl commented

Cargo.toml

[dependencies]
async-tungstenite = { version = "0.13.0", features = ["tokio-runtime", "tokio-native-tls"] }

main.rs

use async_tungstenite::tokio::ConnectStream;

#[derive(Debug)]
struct Foo(ConnectStream);

fn main() {
    println!("Hello, world!");
}

This produce compile error : error[E0277]: async_tungstenite::stream::Stream<TokioAdapter<tokio::net::tcp::stream::TcpStream>, TokioAdapter<tokio_native_tls::TlsStream<tokio::net::tcp::stream::TcpStream>>> doesn't implement Debug

I hope this type implements debug.

It might be sufficient to #[derive(Debug)] in

pub enum Stream<S, T> {

It might also be necessary to implement Debug for other types then though, including tokio_native_tls::TlsStream.

Do you want to give it a try?

hn-sl commented

I just confirmed that adding #[derive(Debug)] to the Stream in your comment is sufficient.

Great, do you want to submit a PR for that?

hn-sl commented

Sure I just submitted it.

Thanks :)