Remove unnecessary PhantomDatas

This commit is contained in:
Luke Parker
2022-11-01 20:58:59 -04:00
parent 5832007a45
commit 9a26ac6899
2 changed files with 2 additions and 13 deletions

View File

@@ -1,7 +1,4 @@
use std::{ use std::sync::{Arc, RwLock};
marker::PhantomData,
sync::{Arc, RwLock},
};
use log::warn; use log::warn;
@@ -30,8 +27,6 @@ use crate::{
/// Tendermint import handler. /// Tendermint import handler.
pub struct TendermintImport<T: TendermintValidator> { pub struct TendermintImport<T: TendermintValidator> {
_ta: PhantomData<T>,
pub(crate) validators: Arc<TendermintValidators<T>>, pub(crate) validators: Arc<TendermintValidators<T>>,
pub(crate) providers: Arc<AsyncRwLock<Option<T::CIDP>>>, pub(crate) providers: Arc<AsyncRwLock<Option<T::CIDP>>>,
@@ -45,8 +40,6 @@ pub struct TendermintImport<T: TendermintValidator> {
impl<T: TendermintValidator> Clone for TendermintImport<T> { impl<T: TendermintValidator> Clone for TendermintImport<T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
TendermintImport { TendermintImport {
_ta: PhantomData,
validators: self.validators.clone(), validators: self.validators.clone(),
providers: self.providers.clone(), providers: self.providers.clone(),
@@ -61,8 +54,6 @@ impl<T: TendermintValidator> Clone for TendermintImport<T> {
impl<T: TendermintValidator> TendermintImport<T> { impl<T: TendermintValidator> TendermintImport<T> {
pub(crate) fn new(client: Arc<T::Client>) -> TendermintImport<T> { pub(crate) fn new(client: Arc<T::Client>) -> TendermintImport<T> {
TendermintImport { TendermintImport {
_ta: PhantomData,
validators: Arc::new(TendermintValidators::new(client.clone())), validators: Arc::new(TendermintValidators::new(client.clone())),
providers: Arc::new(AsyncRwLock::new(None)), providers: Arc::new(AsyncRwLock::new(None)),

View File

@@ -1,4 +1,4 @@
use core::{marker::PhantomData, ops::Deref}; use core::ops::Deref;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use async_trait::async_trait; use async_trait::async_trait;
@@ -54,7 +54,6 @@ impl TendermintValidatorsStruct {
// Wrap every access of the validators struct in something which forces calling refresh // Wrap every access of the validators struct in something which forces calling refresh
struct Refresh<T: TendermintClient> { struct Refresh<T: TendermintClient> {
_tc: PhantomData<T>,
client: Arc<T::Client>, client: Arc<T::Client>,
_refresh: Arc<RwLock<TendermintValidatorsStruct>>, _refresh: Arc<RwLock<TendermintValidatorsStruct>>,
} }
@@ -93,7 +92,6 @@ impl<T: TendermintClient> TendermintValidators<T> {
pub(crate) fn new(client: Arc<T::Client>) -> TendermintValidators<T> { pub(crate) fn new(client: Arc<T::Client>) -> TendermintValidators<T> {
TendermintValidators( TendermintValidators(
Refresh { Refresh {
_tc: PhantomData,
_refresh: Arc::new(RwLock::new(TendermintValidatorsStruct::from_module::<T>(&client))), _refresh: Arc::new(RwLock::new(TendermintValidatorsStruct::from_module::<T>(&client))),
client, client,
}, },