Remove unnecessary PhantomDatas

This commit is contained in:
Luke Parker 2022-11-01 20:58:59 -04:00
parent 5832007a45
commit 9a26ac6899
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6
2 changed files with 2 additions and 13 deletions

View file

@ -1,7 +1,4 @@
use std::{
marker::PhantomData,
sync::{Arc, RwLock},
};
use std::sync::{Arc, RwLock};
use log::warn;
@ -30,8 +27,6 @@ use crate::{
/// Tendermint import handler.
pub struct TendermintImport<T: TendermintValidator> {
_ta: PhantomData<T>,
pub(crate) validators: Arc<TendermintValidators<T>>,
pub(crate) providers: Arc<AsyncRwLock<Option<T::CIDP>>>,
@ -45,8 +40,6 @@ pub struct TendermintImport<T: TendermintValidator> {
impl<T: TendermintValidator> Clone for TendermintImport<T> {
fn clone(&self) -> Self {
TendermintImport {
_ta: PhantomData,
validators: self.validators.clone(),
providers: self.providers.clone(),
@ -61,8 +54,6 @@ impl<T: TendermintValidator> Clone for TendermintImport<T> {
impl<T: TendermintValidator> TendermintImport<T> {
pub(crate) fn new(client: Arc<T::Client>) -> TendermintImport<T> {
TendermintImport {
_ta: PhantomData,
validators: Arc::new(TendermintValidators::new(client.clone())),
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 async_trait::async_trait;
@ -54,7 +54,6 @@ impl TendermintValidatorsStruct {
// Wrap every access of the validators struct in something which forces calling refresh
struct Refresh<T: TendermintClient> {
_tc: PhantomData<T>,
client: Arc<T::Client>,
_refresh: Arc<RwLock<TendermintValidatorsStruct>>,
}
@ -93,7 +92,6 @@ impl<T: TendermintClient> TendermintValidators<T> {
pub(crate) fn new(client: Arc<T::Client>) -> TendermintValidators<T> {
TendermintValidators(
Refresh {
_tc: PhantomData,
_refresh: Arc::new(RwLock::new(TendermintValidatorsStruct::from_module::<T>(&client))),
client,
},