More concerns

This commit is contained in:
Pierre Krieger 2018-01-04 12:11:21 +01:00
parent aa2c4a2a45
commit ed5a24c591
No known key found for this signature in database
GPG Key ID: A03CE3AD81F08F7C

View File

@ -74,15 +74,14 @@ impl<C> ConnectionUpgrade<C> for IdentifyProtocol
{ {
type NamesIter = iter::Once<(Bytes, Self::UpgradeIdentifier)>; type NamesIter = iter::Once<(Bytes, Self::UpgradeIdentifier)>;
type UpgradeIdentifier = (); type UpgradeIdentifier = ();
type Output = Option<IdentifyInfo>;
type Future = Box<Future<Item = Self::Output, Error = IoError>>;
#[inline] #[inline]
fn protocol_names(&self) -> Self::NamesIter { fn protocol_names(&self) -> Self::NamesIter {
iter::once((Bytes::from("/ipfs/id/1.0.0"), ())) iter::once((Bytes::from("/ipfs/id/1.0.0"), ()))
} }
type Output = Option<IdentifyInfo>;
type Future = Box<Future<Item = Self::Output, Error = IoError>>;
fn upgrade(self, socket: C, _: (), ty: Endpoint) -> Self::Future { fn upgrade(self, socket: C, _: (), ty: Endpoint) -> Self::Future {
// TODO: use jack's varint library instead // TODO: use jack's varint library instead
let socket = length_delimited::Builder::new().length_field_length(1).new_framed(socket); let socket = length_delimited::Builder::new().length_field_length(1).new_framed(socket);