From fb90490c2c968b4c3f36b16ea2720afa8ba389e9 Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Wed, 19 Jul 2023 16:17:08 +0200 Subject: [PATCH] routing: remove Node struct Remove struct scylla::routing::Node from routing.rs. This structure was introduced in 2020 in 1c8df890d6419e4612fbdbb4aef1fb68c35ffb88 and it is unused in our current code (and it looks like the original commit didn't even use it at all). Moreover, this struct clashes with scylla::transport::Node making it error-prone to find the wrong Node struct for a user of the driver. The deleted Node structure also relied solely on SocketAddr, while we want to identify the nodes by host_id (as in scylla::transport::Node). Refs #660. --- scylla/src/routing.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scylla/src/routing.rs b/scylla/src/routing.rs index ac9cda7e75..5df667fefd 100644 --- a/scylla/src/routing.rs +++ b/scylla/src/routing.rs @@ -1,17 +1,9 @@ use rand::Rng; use std::collections::HashMap; use std::convert::TryFrom; -use std::net::SocketAddr; use std::num::NonZeroU16; use thiserror::Error; -#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] -pub struct Node { - // TODO: potentially a node may have multiple addresses, remember them? - // but we need an Ord instance on Node - pub addr: SocketAddr, -} - #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)] pub struct Token { pub value: i64,