Skip to content

Commit bb022c9

Browse files
committed
Use of Default
1 parent 1107a9a commit bb022c9

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/agent/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ impl State {
8989
local_store: local::Store::new(registry),
9090
keypairs: keypairs::KeypairState::default(),
9191
prices: api::PricesState::new(config.state.clone()),
92-
oracle: oracle::OracleState::new(),
9392
exporter: exporter::ExporterState::new(),
93+
oracle: oracle::OracleState::default(),
9494
transactions: transactions::TransactionsState::new(
9595
config
9696
.primary_network
@@ -109,8 +109,8 @@ impl State {
109109
local_store: local::Store::new(registry),
110110
keypairs: keypairs::KeypairState::default(),
111111
prices: api::PricesState::new(config),
112-
oracle: oracle::OracleState::new(),
113112
exporter: exporter::ExporterState::new(),
113+
oracle: oracle::OracleState::default(),
114114
transactions: transactions::TransactionsState::new(100),
115115
}
116116
}

src/agent/state/oracle.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,11 @@ impl Default for Config {
173173
}
174174
}
175175

176+
#[derive(Default)]
176177
pub struct OracleState {
177178
data: RwLock<Data>,
178179
}
179180

180-
impl OracleState {
181-
pub fn new() -> Self {
182-
Self {
183-
data: Default::default(),
184-
}
185-
}
186-
}
187-
188181
#[async_trait::async_trait]
189182
pub trait Oracle {
190183
async fn sync_global_store(&self, network: Network) -> Result<()>;

0 commit comments

Comments
 (0)