From eb21eef5ab1333514dbd58bcbe36da2f69c2c293 Mon Sep 17 00:00:00 2001 From: James Ray <16969914+jamesray1@users.noreply.github.com> Date: Mon, 17 Sep 2018 18:42:43 +1000 Subject: [PATCH] Change one instance of topic.hash to topic.descriptor.name, and set topic.descriptor to public, and file an issue for the name field in TopicDescriptor to set it to public: https://github.com/stepancheg/rust-protobuf/issues/336 --- protocols/floodsub/src/lib.rs | 2 +- protocols/floodsub/src/topic.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/floodsub/src/lib.rs b/protocols/floodsub/src/lib.rs index f2b74c4b92d..49723637b79 100644 --- a/protocols/floodsub/src/lib.rs +++ b/protocols/floodsub/src/lib.rs @@ -359,7 +359,7 @@ impl FloodSubController { for (topic, subscribe) in topics { let mut subscription = rpc_proto::RPC_SubOpts::new(); subscription.set_subscribe(subscribe); - subscription.set_topicid(topic.hash().clone().into_string()); + subscription.set_topicid(topic.descriptor.name); proto.mut_subscriptions().push(subscription); if subscribe { diff --git a/protocols/floodsub/src/topic.rs b/protocols/floodsub/src/topic.rs index fc8d280d8c1..8d98892c81d 100644 --- a/protocols/floodsub/src/topic.rs +++ b/protocols/floodsub/src/topic.rs @@ -47,7 +47,7 @@ impl TopicHash { /// Built topic. #[derive(Debug, Clone)] pub struct Topic { - descriptor: rpc_proto::TopicDescriptor, + pub descriptor: rpc_proto::TopicDescriptor, hash: TopicHash, }