Skip to content

Commit

Permalink
fix: String wasn't added to strings pool
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilMihaylov committed Dec 12, 2023
1 parent 2f377df commit d77c955
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions market-data-feeder/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ impl<'de> Deserialize<'de> for Config {
let mut oracles: BTreeMap<Arc<str>, Arc<str>> = BTreeMap::new();

for (raw_oracle_id, raw_oracle_addr) in raw_oracles {
#[cfg(debug_assertions)]
let None: Option<Arc<str>> = oracles.insert(
let result = oracles.insert(
str_pool.get_or_insert(raw_oracle_id),
str_pool.get_or_insert(raw_oracle_addr),
) else {
);

#[cfg(debug_assertions)]
if result.is_some() {
unreachable!()
};
#[cfg(not(debug_assertions))]
oracles.insert(raw_oracle_id, str_pool.get_or_insert(raw_oracle_addr));
}
}

let comparison_providers: BTreeMap<Arc<str>, ComparisonProvider> =
Expand Down

0 comments on commit d77c955

Please sign in to comment.