From c693710fe4f84b25f7cd55d97a9451e04d85b7b5 Mon Sep 17 00:00:00 2001
From: Georgy Moshkin <gmoshkin@picodata.io>
Date: Thu, 30 Jun 2022 19:59:57 +0300
Subject: [PATCH] chore: fix warnings

---
 src/traft/mod.rs      | 9 +--------
 src/traft/node.rs     | 1 -
 src/traft/storage.rs  | 2 ++
 src/traft/topology.rs | 2 +-
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/traft/mod.rs b/src/traft/mod.rs
index d875edeafc..7dde17c8c3 100644
--- a/src/traft/mod.rs
+++ b/src/traft/mod.rs
@@ -266,14 +266,6 @@ impl Entry {
             None => None,
         }
     }
-
-    /// Returns the iterator over contained `Vec<Peer>` if it's an `EntryConfChange`.
-    fn iter_peers(&self) -> std::slice::Iter<'_, Peer> {
-        match &self.context {
-            Some(EntryContext::ConfChange(v)) => v.peers.iter(),
-            _ => (&[]).iter(),
-        }
-    }
 }
 
 impl EntryContext {
@@ -474,6 +466,7 @@ pub struct SetActiveRequest {
 impl AsTuple for SetActiveRequest {}
 
 impl SetActiveRequest {
+    #[allow(dead_code)]
     #[inline]
     pub fn activate(instance_id: impl Into<String>, cluster_id: impl Into<String>) -> Self {
         Self {
diff --git a/src/traft/node.rs b/src/traft/node.rs
index ed16891202..9c131e2dcc 100644
--- a/src/traft/node.rs
+++ b/src/traft/node.rs
@@ -14,7 +14,6 @@ use ::tarantool::fiber;
 use ::tarantool::proc;
 use ::tarantool::tlua;
 use ::tarantool::transaction::start_transaction;
-use std::any::type_name;
 use std::any::Any;
 use std::cell::RefCell;
 use std::collections::HashMap;
diff --git a/src/traft/storage.rs b/src/traft/storage.rs
index 7427ab400e..7091ce29a8 100644
--- a/src/traft/storage.rs
+++ b/src/traft/storage.rs
@@ -212,6 +212,7 @@ impl Storage {
         Storage::raft_state("raft_id")
     }
 
+    #[allow(dead_code)]
     pub fn instance_id() -> Result<Option<String>, StorageError> {
         Storage::raft_state("instance_id")
     }
@@ -299,6 +300,7 @@ impl Storage {
         Ok(())
     }
 
+    #[allow(dead_code)]
     pub fn delete_peer(raft_id: u64) -> Result<(), StorageError> {
         Storage::space(RAFT_GROUP)?
             .delete(&[raft_id])
diff --git a/src/traft/topology.rs b/src/traft/topology.rs
index 93c56e680c..a1f7766576 100644
--- a/src/traft/topology.rs
+++ b/src/traft/topology.rs
@@ -106,7 +106,7 @@ impl Topology {
             instance_id,
             instance_uuid,
             raft_id,
-            peer_address: advertise.into(),
+            peer_address: advertise,
             replicaset_id,
             replicaset_uuid,
             commit_index: INVALID_INDEX,
-- 
GitLab