Skip to content

Commit def00ca

Browse files
committed
Inline some single-use bindings
1 parent a6ee2fe commit def00ca

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/connector.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,19 @@ where
102102
return Box::pin(async move { Err(Box::new(err).into()) });
103103
}
104104
};
105-
let connecting_future = self.http.call(dst);
106105

107-
let f = async move {
106+
let connecting_future = self.http.call(dst);
107+
Box::pin(async move {
108108
let tcp = connecting_future
109109
.await
110110
.map_err(Into::into)?;
111-
let connector = TlsConnector::from(cfg);
112-
let tls = connector
113-
.connect(hostname, tcp)
114-
.await
115-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
116-
Ok(MaybeHttpsStream::Https(tls))
117-
};
118-
Box::pin(f)
111+
Ok(MaybeHttpsStream::Https(
112+
TlsConnector::from(cfg)
113+
.connect(hostname, tcp)
114+
.await
115+
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?,
116+
))
117+
})
119118
}
120119
}
121120

0 commit comments

Comments
 (0)