Change Connected::connect_info to return Self (#396)

I've been thinking that having an associated type probably isn't
necessary. I imagine most users are either using `SocketAddr` to the
remote connection IP, or writing their own connection struct.
This commit is contained in:
David Pedersen
2021-10-19 23:06:15 +02:00
committed by GitHub
parent a724af3d0a
commit 9fcc884374
4 changed files with 10 additions and 18 deletions
+1 -3
View File
@@ -156,9 +156,7 @@ struct UdsConnectInfo {
}
impl connect_info::Connected<&UnixStream> for UdsConnectInfo {
type ConnectInfo = Self;
fn connect_info(target: &UnixStream) -> Self::ConnectInfo {
fn connect_info(target: &UnixStream) -> Self {
let peer_addr = target.peer_addr().unwrap();
let peer_cred = target.peer_cred().unwrap();