Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 96eaaa2

Browse files
committed
Fmt, bump futures-util
1 parent d0b177e commit 96eaaa2

File tree

17 files changed

+211
-230
lines changed

17 files changed

+211
-230
lines changed

Cargo.lock

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/src/client/api/block_builder/input_selection/core/requirement/amount.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ pub(crate) fn sdruc_not_expired(output: &Output, current_time: u32) -> Option<&S
2727
.map_or(false, |expiration| current_time >= expiration.timestamp());
2828

2929
// We only have to send the storage deposit return back if the output is not expired
30-
if !expired { Some(sdr) } else { None }
30+
if !expired {
31+
Some(sdr)
32+
} else {
33+
None
34+
}
3135
})
3236
}
3337

sdk/src/types/api/plugins/participation/types.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,11 @@ impl Participations {
247247

248248
/// Serialize to bytes.
249249
pub fn to_bytes(&self) -> Result<Vec<u8>, Error> {
250-
let mut bytes = vec![
251-
self.participations
252-
.len()
253-
.try_into()
254-
.map_err(|_| Error::InvalidParticipations)?,
255-
];
250+
let mut bytes = vec![self
251+
.participations
252+
.len()
253+
.try_into()
254+
.map_err(|_| Error::InvalidParticipations)?];
256255

257256
for participation in &self.participations {
258257
let event_id: Vec<u8> = participation.event_id.pack_to_vec();

sdk/src/types/block/output/alias_id.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ impl From<&OutputId> for AliasId {
2020
impl AliasId {
2121
///
2222
pub fn or_from_output_id(self, output_id: &OutputId) -> Self {
23-
if self.is_null() { Self::from(output_id) } else { self }
23+
if self.is_null() {
24+
Self::from(output_id)
25+
} else {
26+
self
27+
}
2428
}
2529
}
2630

sdk/src/types/block/output/nft_id.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ impl From<&OutputId> for NftId {
2020
impl NftId {
2121
///
2222
pub fn or_from_output_id(self, output_id: &OutputId) -> Self {
23-
if self.is_null() { Self::from(output_id) } else { self }
23+
if self.is_null() {
24+
Self::from(output_id)
25+
} else {
26+
self
27+
}
2428
}
2529
}
2630

sdk/src/types/block/rand/option.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ use crate::types::block::rand::bool::rand_bool;
55

66
/// Generates a random generic option.
77
pub fn rand_option<T>(inner: T) -> Option<T> {
8-
if rand_bool() { Some(inner) } else { None }
8+
if rand_bool() {
9+
Some(inner)
10+
} else {
11+
None
12+
}
913
}

sdk/src/wallet/account/operations/output_finder.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ where
102102
.map(|a| {
103103
// If the index is 1, then we only have the single address before we got during account creation
104104
// To also sync that, we set the index to 0
105-
if a.key_index == 1 { 0 } else { a.key_index }
105+
if a.key_index == 1 {
106+
0
107+
} else {
108+
a.key_index
109+
}
106110
})
107111
// +1, because we don't want to sync the latest address again
108112
.unwrap_or(highest_public_address_index + 1);

sdk/src/wallet/storage/manager.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,17 @@ mod tests {
182182
#[tokio::test]
183183
async fn save_get_wallet_data() {
184184
let storage_manager = StorageManager::new(Memory::default(), None).await.unwrap();
185-
assert!(
186-
WalletBuilder::<SecretManager>::load(&storage_manager)
187-
.await
188-
.unwrap()
189-
.is_none()
190-
);
185+
assert!(WalletBuilder::<SecretManager>::load(&storage_manager)
186+
.await
187+
.unwrap()
188+
.is_none());
191189

192190
let wallet_builder = WalletBuilder::<SecretManager>::new();
193191
wallet_builder.save(&storage_manager).await.unwrap();
194192

195-
assert!(
196-
WalletBuilder::<SecretManager>::load(&storage_manager)
197-
.await
198-
.unwrap()
199-
.is_some()
200-
);
193+
assert!(WalletBuilder::<SecretManager>::load(&storage_manager)
194+
.await
195+
.unwrap()
196+
.is_some());
201197
}
202198
}

0 commit comments

Comments
 (0)