mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Remove unnecessary PhantomDatas
This commit is contained in:
@@ -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)),
|
||||||
|
|||||||
@@ -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,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user