From 21ab1bb4343c99e11ba45b3b84fbc9e91d12f127 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 16 Dec 2022 11:45:42 +0100 Subject: [PATCH] Remove unnecessary `PeerId` parsing code --- crates/rpc/src/proto.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/crates/rpc/src/proto.rs b/crates/rpc/src/proto.rs index 385caf3565..f833db514d 100644 --- a/crates/rpc/src/proto.rs +++ b/crates/rpc/src/proto.rs @@ -6,7 +6,6 @@ use prost::Message as _; use serde::Serialize; use std::any::{Any, TypeId}; use std::fmt; -use std::str::FromStr; use std::{ cmp, fmt::Debug, @@ -119,23 +118,6 @@ impl fmt::Display for PeerId { } } -impl FromStr for PeerId { - type Err = anyhow::Error; - - fn from_str(s: &str) -> Result { - let mut components = s.split('/'); - let owner_id = components - .next() - .ok_or_else(|| anyhow!("invalid peer id {:?}", s))? - .parse()?; - let id = components - .next() - .ok_or_else(|| anyhow!("invalid peer id {:?}", s))? - .parse()?; - Ok(PeerId { owner_id, id }) - } -} - messages!( (Ack, Foreground), (AddProjectCollaborator, Foreground),