mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-20 21:36:31 +00:00
Replace protobuf crate with prost! (#1390)
* Replace protobuf crate with prost! * Add copyright headers to build.rs files. * kad: Fix error when mapping connection types. Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> * Fix more mapping mistakes. Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
committed by
Pierre Krieger
parent
9d2df148cd
commit
680c467f7e
@ -21,7 +21,6 @@
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
use std::io::Error as IoError;
|
||||
use protobuf::error::ProtobufError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum PlainTextError {
|
||||
@ -29,7 +28,7 @@ pub enum PlainTextError {
|
||||
IoError(IoError),
|
||||
|
||||
/// Failed to parse the handshake protobuf message.
|
||||
InvalidPayload(Option<ProtobufError>),
|
||||
InvalidPayload(Option<prost::DecodeError>),
|
||||
|
||||
/// The peer id of the exchange isn't consistent with the remote public key.
|
||||
InvalidPeerId,
|
||||
@ -68,8 +67,8 @@ impl From<IoError> for PlainTextError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ProtobufError> for PlainTextError {
|
||||
fn from(err: ProtobufError) -> PlainTextError {
|
||||
impl From<prost::DecodeError> for PlainTextError {
|
||||
fn from(err: prost::DecodeError) -> PlainTextError {
|
||||
PlainTextError::InvalidPayload(Some(err))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user