Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Jul 17, 2024
1 parent 89d9123 commit d02fffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions objects/src/accounts/delta/storage.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::HashMap;

use alloc::{string::ToString, vec::Vec};
use std::collections::HashMap;

use super::{
AccountDeltaError, ByteReader, ByteWriter, Deserializable, DeserializationError, Felt,
Expand Down
11 changes: 3 additions & 8 deletions objects/src/accounts/delta/vault.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::HashMap;

use alloc::{string::ToString, vec::Vec};
use std::collections::HashMap;

use super::{
AccountDeltaError, Asset, ByteReader, ByteWriter, Deserializable, DeserializationError,
Expand Down Expand Up @@ -55,12 +54,8 @@ impl AccountVaultDelta {
.chain(other.removed_assets.into_iter().map(|asset| (asset, false)))
.collect::<HashMap<_, _>>();

let added = assets
.iter()
.filter_map(|(asset, was_added)| was_added.then_some(asset.clone()));
let removed = assets
.iter()
.filter_map(|(asset, was_added)| (!was_added).then_some(asset.clone()));
let added = assets.iter().filter_map(|(asset, was_added)| was_added.then_some(*asset));
let removed = assets.iter().filter_map(|(asset, was_added)| (!was_added).then_some(*asset));

Self::from_iterators(added, removed)
}
Expand Down

0 comments on commit d02fffc

Please sign in to comment.