Skip to content

Conversation

@oguzbilgener
Copy link
Contributor

Hey, thank you so much for this library. It performs very well :)

While using it, I noticed that the compiler won't let me clone a MuxConector<TcpStream> instance. The Clone implementation created by #[derive(Clone)] requires T to be cloneable as well:

error[E0599]: the method `clone` exists for struct `MuxConnector<TcpStream>`, but its trait bounds were not satisfied --> src/lib.rs:113:35 | 113 | let stream1 = connector_a.clone().connect().unwrap(); | ^^^^^ ::: /Users/oguz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/net/tcp/stream.rs:69:5 | 69 | pub struct TcpStream { | -------------------- doesn't satisfy `tokio::net::TcpStream: Clone` | 

So a manual clone implementation could save the day.

@black-binary
Copy link
Owner

Thank you for the fix! :)

@black-binary black-binary merged commit 266d487 into black-binary:main Jul 13, 2023
@oguzbilgener oguzbilgener deleted the fix-muxconn-clone branch July 13, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants