Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 7dcc77b

Browse files
authored
Remove extra commas made redundent after rustfmt (#9404)
* Remove extra commas made redundent after rustfmt
1 parent fced297 commit 7dcc77b

File tree

101 files changed

+309
-309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+309
-309
lines changed

bin/node/executor/tests/basic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ fn full_native_block_import_works() {
427427
Balances::total_balance(&alice()),
428428
alice_last_known_balance - 10 * DOLLARS - fees,
429429
);
430-
assert_eq!(Balances::total_balance(&bob()), 179 * DOLLARS - fees,);
430+
assert_eq!(Balances::total_balance(&bob()), 179 * DOLLARS - fees);
431431
let events = vec![
432432
EventRecord {
433433
phase: Phase::ApplyExtrinsic(0),
@@ -529,7 +529,7 @@ fn full_wasm_block_import_works() {
529529
Balances::total_balance(&alice()),
530530
alice_last_known_balance - 10 * DOLLARS - fees,
531531
);
532-
assert_eq!(Balances::total_balance(&bob()), 179 * DOLLARS - 1 * fees,);
532+
assert_eq!(Balances::total_balance(&bob()), 179 * DOLLARS - 1 * fees);
533533
});
534534
}
535535

bin/utils/chain-spec-builder/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn print_seeds(
203203
println!("{}", header.paint("Authority seeds"));
204204

205205
for (n, seed) in authority_seeds.iter().enumerate() {
206-
println!("{} //{}", entry.paint(format!("auth-{}:", n)), seed,);
206+
println!("{} //{}", entry.paint(format!("auth-{}:", n)), seed);
207207
}
208208

209209
println!("{}", header.paint("Nominator seeds"));
@@ -217,7 +217,7 @@ fn print_seeds(
217217
if !endowed_seeds.is_empty() {
218218
println!("{}", header.paint("Endowed seeds"));
219219
for (n, seed) in endowed_seeds.iter().enumerate() {
220-
println!("{} //{}", entry.paint(format!("endowed-{}:", n)), seed,);
220+
println!("{} //{}", entry.paint(format!("endowed-{}:", n)), seed);
221221
}
222222

223223
println!();

client/authority-discovery/src/worker.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,15 @@ where
421421

422422
if log_enabled!(log::Level::Debug) {
423423
let hashes: Vec<_> = v.iter().map(|(hash, _value)| hash.clone()).collect();
424-
debug!(target: LOG_TARGET, "Value for hash '{:?}' found on Dht.", hashes,);
424+
debug!(target: LOG_TARGET, "Value for hash '{:?}' found on Dht.", hashes);
425425
}
426426

427427
if let Err(e) = self.handle_dht_value_found_event(v) {
428428
if let Some(metrics) = &self.metrics {
429429
metrics.handle_value_found_event_failure.inc();
430430
}
431431

432-
debug!(target: LOG_TARGET, "Failed to handle Dht value found event: {:?}", e,);
432+
debug!(target: LOG_TARGET, "Failed to handle Dht value found event: {:?}", e);
433433
}
434434
},
435435
DhtEvent::ValueNotFound(hash) => {
@@ -456,7 +456,7 @@ where
456456
metrics.dht_event_received.with_label_values(&["value_put"]).inc();
457457
}
458458

459-
debug!(target: LOG_TARGET, "Successfully put hash '{:?}' on Dht.", hash,)
459+
debug!(target: LOG_TARGET, "Successfully put hash '{:?}' on Dht.", hash)
460460
},
461461
DhtEvent::ValuePutFailed(hash) => {
462462
if let Some(metrics) = &self.metrics {

client/cli/src/params/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl FromStr for GenericNumber {
4949

5050
fn from_str(block_number: &str) -> Result<Self, Self::Err> {
5151
if let Some(pos) = block_number.chars().position(|d| !d.is_digit(10)) {
52-
Err(format!("Expected block number, found illegal digit at position: {}", pos,))
52+
Err(format!("Expected block number, found illegal digit at position: {}", pos))
5353
} else {
5454
Ok(Self(block_number.to_owned()))
5555
}

client/cli/src/runner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl<C: SubstrateCli> Runner<C> {
206206
pub fn print_node_infos<C: SubstrateCli>(config: &Configuration) {
207207
info!("{}", C::impl_name());
208208
info!("✌️ version {}", C::impl_version());
209-
info!("❤️ by {}, {}-{}", C::author(), C::copyright_start_year(), Local::today().year(),);
209+
info!("❤️ by {}, {}-{}", C::author(), C::copyright_start_year(), Local::today().year());
210210
info!("📋 Chain specification: {}", config.chain_spec.name());
211211
info!("🏷 Node name: {}", config.network.node_name);
212212
info!("👤 Role: {}", config.display_role());

client/consensus/babe/src/aux_schema.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ mod test {
170170
)
171171
.unwrap();
172172

173-
assert_eq!(load_decode::<_, u32>(&client, BABE_EPOCH_CHANGES_VERSION).unwrap(), None,);
173+
assert_eq!(load_decode::<_, u32>(&client, BABE_EPOCH_CHANGES_VERSION).unwrap(), None);
174174

175175
let epoch_changes = load_epoch_changes::<TestBlock, _>(
176176
&client,
@@ -202,6 +202,6 @@ mod test {
202202
client.insert_aux(values, &[]).unwrap();
203203
});
204204

205-
assert_eq!(load_decode::<_, u32>(&client, BABE_EPOCH_CHANGES_VERSION).unwrap(), Some(2),);
205+
assert_eq!(load_decode::<_, u32>(&client, BABE_EPOCH_CHANGES_VERSION).unwrap(), Some(2));
206206
}
207207
}

client/consensus/babe/src/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -780,10 +780,10 @@ fn importing_epoch_change_block_prunes_tree() {
780780
let fork_3 = propose_and_import_blocks(BlockId::Hash(canon_hashes[18]), 10);
781781

782782
// We should be tracking a total of 9 epochs in the fork tree
783-
assert_eq!(epoch_changes.shared_data().tree().iter().count(), 9,);
783+
assert_eq!(epoch_changes.shared_data().tree().iter().count(), 9);
784784

785785
// And only one root
786-
assert_eq!(epoch_changes.shared_data().tree().roots().count(), 1,);
786+
assert_eq!(epoch_changes.shared_data().tree().roots().count(), 1);
787787

788788
// We finalize block #13 from the canon chain, so on the next epoch
789789
// change the tree should be pruned, to not contain F (#7).

client/consensus/slots/src/aux_schema.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,21 @@ mod test {
169169
let header6 = create_header(3); // @ slot 4
170170

171171
// It's ok to sign same headers.
172-
assert!(check_equivocation(&client, 2.into(), 2.into(), &header1, &public,)
172+
assert!(check_equivocation(&client, 2.into(), 2.into(), &header1, &public)
173173
.unwrap()
174174
.is_none(),);
175175

176-
assert!(check_equivocation(&client, 3.into(), 2.into(), &header1, &public,)
176+
assert!(check_equivocation(&client, 3.into(), 2.into(), &header1, &public)
177177
.unwrap()
178178
.is_none(),);
179179

180180
// But not two different headers at the same slot.
181-
assert!(check_equivocation(&client, 4.into(), 2.into(), &header2, &public,)
181+
assert!(check_equivocation(&client, 4.into(), 2.into(), &header2, &public)
182182
.unwrap()
183183
.is_some(),);
184184

185185
// Different slot is ok.
186-
assert!(check_equivocation(&client, 5.into(), 4.into(), &header3, &public,)
186+
assert!(check_equivocation(&client, 5.into(), 4.into(), &header3, &public)
187187
.unwrap()
188188
.is_none(),);
189189

client/consensus/slots/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
318318
let proposal = match futures::future::select(proposing, proposing_remaining).await {
319319
Either::Left((Ok(p), _)) => p,
320320
Either::Left((Err(err), _)) => {
321-
warn!(target: logging_target, "Proposing failed: {:?}", err,);
321+
warn!(target: logging_target, "Proposing failed: {:?}", err);
322322

323323
return None
324324
},
@@ -363,7 +363,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
363363
) {
364364
Ok(bi) => bi,
365365
Err(err) => {
366-
warn!(target: logging_target, "Failed to create block import params: {:?}", err,);
366+
warn!(target: logging_target, "Failed to create block import params: {:?}", err);
367367

368368
return None
369369
},
@@ -922,7 +922,7 @@ mod test {
922922
}
923923

924924
// but we cap it to a maximum of 20 slots
925-
assert_eq!(super::slot_lenience_linear(1u64.into(), &slot(23)), Some(SLOT_DURATION * 20),);
925+
assert_eq!(super::slot_lenience_linear(1u64.into(), &slot(23)), Some(SLOT_DURATION * 20));
926926
}
927927

928928
#[test]

client/consensus/slots/src/slots.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn duration_now() -> Duration {
3333
use std::time::SystemTime;
3434
let now = SystemTime::now();
3535
now.duration_since(SystemTime::UNIX_EPOCH).unwrap_or_else(|e| {
36-
panic!("Current time {:?} is before unix epoch. Something is wrong: {:?}", now, e,)
36+
panic!("Current time {:?} is before unix epoch. Something is wrong: {:?}", now, e)
3737
})
3838
}
3939

client/db/src/light.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1155,39 +1155,39 @@ pub(crate) mod tests {
11551155

11561156
let hash7 =
11571157
insert_block(&db, make_authorities(vec![auth3()]), || default_header(&hash6, 7));
1158-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1158+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
11591159
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), Some(vec![auth3()]));
11601160
let hash8 =
11611161
insert_block(&db, make_authorities(vec![auth3()]), || default_header(&hash7, 8));
1162-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1162+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
11631163
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), Some(vec![auth3()]));
11641164
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), Some(vec![auth3()]));
11651165
let hash6_1 =
11661166
insert_block(&db, make_authorities(vec![auth4()]), || default_header(&hash6, 7));
1167-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1167+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
11681168
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), Some(vec![auth3()]));
11691169
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), Some(vec![auth3()]));
11701170
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1)), Some(vec![auth4()]));
11711171
let hash6_1_1 = insert_non_best_block(&db, make_authorities(vec![auth5()]), || {
11721172
default_header(&hash6_1, 8)
11731173
});
1174-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1174+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
11751175
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), Some(vec![auth3()]));
11761176
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), Some(vec![auth3()]));
11771177
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1)), Some(vec![auth4()]));
11781178
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1_1)), Some(vec![auth5()]));
11791179
let hash6_1_2 = insert_non_best_block(&db, make_authorities(vec![auth6()]), || {
11801180
default_header(&hash6_1, 8)
11811181
});
1182-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1182+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
11831183
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), Some(vec![auth3()]));
11841184
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), Some(vec![auth3()]));
11851185
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1)), Some(vec![auth4()]));
11861186
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1_1)), Some(vec![auth5()]));
11871187
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1_2)), Some(vec![auth6()]));
11881188
let hash6_2 =
11891189
insert_block(&db, make_authorities(vec![auth4()]), || default_header(&hash6_1, 8));
1190-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1190+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
11911191
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), Some(vec![auth3()]));
11921192
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), Some(vec![auth3()]));
11931193
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1)), Some(vec![auth4()]));
@@ -1201,7 +1201,7 @@ pub(crate) mod tests {
12011201
{
12021202
// finalize block hash6_1
12031203
db.finalize_header(BlockId::Hash(hash6_1)).unwrap();
1204-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1204+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
12051205
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), None);
12061206
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), None);
12071207
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1)), Some(vec![auth4()]));
@@ -1210,7 +1210,7 @@ pub(crate) mod tests {
12101210
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_2)), Some(vec![auth4()]));
12111211
// finalize block hash6_2
12121212
db.finalize_header(BlockId::Hash(hash6_2)).unwrap();
1213-
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]),);
1213+
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6)), Some(vec![auth1(), auth2()]));
12141214
assert_eq!(authorities(db.cache(), BlockId::Hash(hash7)), None);
12151215
assert_eq!(authorities(db.cache(), BlockId::Hash(hash8)), None);
12161216
assert_eq!(authorities(db.cache(), BlockId::Hash(hash6_1)), Some(vec![auth4()]));

client/executor/src/integration_tests/sandbox.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn sandbox_should_work(wasm_method: WasmExecutionMethod) {
5151
.unwrap()
5252
.encode();
5353

54-
assert_eq!(call_in_wasm("test_sandbox", &code, wasm_method, &mut ext,).unwrap(), true.encode(),);
54+
assert_eq!(call_in_wasm("test_sandbox", &code, wasm_method, &mut ext).unwrap(), true.encode());
5555
}
5656

5757
test_wasm_execution!(sandbox_trap);
@@ -72,7 +72,7 @@ fn sandbox_trap(wasm_method: WasmExecutionMethod) {
7272
)
7373
.unwrap();
7474

75-
assert_eq!(call_in_wasm("test_sandbox", &code, wasm_method, &mut ext,).unwrap(), vec![0],);
75+
assert_eq!(call_in_wasm("test_sandbox", &code, wasm_method, &mut ext).unwrap(), vec![0]);
7676
}
7777

7878
test_wasm_execution!(start_called);
@@ -111,7 +111,7 @@ fn start_called(wasm_method: WasmExecutionMethod) {
111111
.unwrap()
112112
.encode();
113113

114-
assert_eq!(call_in_wasm("test_sandbox", &code, wasm_method, &mut ext,).unwrap(), true.encode(),);
114+
assert_eq!(call_in_wasm("test_sandbox", &code, wasm_method, &mut ext).unwrap(), true.encode());
115115
}
116116

117117
test_wasm_execution!(invoke_args);

client/executor/src/native_executor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ mod tests {
658658
fn native_executor_registers_custom_interface() {
659659
let executor = NativeExecutor::<MyExecutor>::new(WasmExecutionMethod::Interpreted, None, 8);
660660
my_interface::HostFunctions::host_functions().iter().for_each(|function| {
661-
assert_eq!(executor.wasm.host_functions.iter().filter(|f| f == &function).count(), 2,);
661+
assert_eq!(executor.wasm.host_functions.iter().filter(|f| f == &function).count(), 2);
662662
});
663663

664664
my_interface::say_hello_world("hey");

client/executor/wasmtime/src/instance_wrapper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl InstanceWrapper {
176176
.ok_or_else(|| Error::from(format!("Export {} is not a function", method)))?
177177
.clone();
178178
EntryPoint::direct(func).map_err(|_| {
179-
Error::from(format!("Exported function '{}' has invalid signature.", method,))
179+
Error::from(format!("Exported function '{}' has invalid signature.", method))
180180
})?
181181
},
182182
InvokeMethod::Table(func_ref) => {

client/finality-grandpa/src/authorities.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -780,13 +780,13 @@ mod tests {
780780
authorities.add_pending_change(change(1), &is_descendent_of).unwrap();
781781
authorities.add_pending_change(change(2), &is_descendent_of).unwrap();
782782

783-
assert_eq!(authorities.current_limit(0), Some(1),);
783+
assert_eq!(authorities.current_limit(0), Some(1));
784784

785-
assert_eq!(authorities.current_limit(1), Some(1),);
785+
assert_eq!(authorities.current_limit(1), Some(1));
786786

787-
assert_eq!(authorities.current_limit(2), Some(2),);
787+
assert_eq!(authorities.current_limit(2), Some(2));
788788

789-
assert_eq!(authorities.current_limit(3), None,);
789+
assert_eq!(authorities.current_limit(3), None);
790790
}
791791

792792
#[test]
@@ -910,7 +910,7 @@ mod tests {
910910
.add_pending_change(change_b.clone(), &static_is_descendent_of(true))
911911
.unwrap();
912912

913-
assert_eq!(authorities.pending_changes().collect::<Vec<_>>(), vec![&change_a, &change_b],);
913+
assert_eq!(authorities.pending_changes().collect::<Vec<_>>(), vec![&change_a, &change_b]);
914914

915915
// finalizing "hash_c" won't enact the change signaled at "hash_a" but it will prune out "hash_b"
916916
let status = authorities
@@ -929,7 +929,7 @@ mod tests {
929929

930930
assert!(status.changed);
931931
assert_eq!(status.new_set_block, None);
932-
assert_eq!(authorities.pending_changes().collect::<Vec<_>>(), vec![&change_a],);
932+
assert_eq!(authorities.pending_changes().collect::<Vec<_>>(), vec![&change_a]);
933933
assert_eq!(authorities.authority_set_changes, AuthoritySetChanges::empty());
934934

935935
// finalizing "hash_d" will enact the change signaled at "hash_a"
@@ -1444,7 +1444,7 @@ mod tests {
14441444
);
14451445

14461446
// there's no longer any pending change at `best_b` fork
1447-
assert_eq!(authorities.next_change(&"best_b", &is_descendent_of).unwrap(), None,);
1447+
assert_eq!(authorities.next_change(&"best_b", &is_descendent_of).unwrap(), None);
14481448

14491449
// we a forced change at A10 (#8)
14501450
let change_a10 = PendingChange {
@@ -1666,7 +1666,7 @@ mod tests {
16661666
authority_set_changes.append(2, 81);
16671667

16681668
// we are missing the data for the first set, therefore we should return `None`
1669-
assert_eq!(None, authority_set_changes.iter_from(40).map(|it| it.collect::<Vec<_>>()),);
1669+
assert_eq!(None, authority_set_changes.iter_from(40).map(|it| it.collect::<Vec<_>>()));
16701670

16711671
// after adding the data for the first set the same query should work
16721672
let mut authority_set_changes = AuthoritySetChanges::empty();
@@ -1685,8 +1685,8 @@ mod tests {
16851685
authority_set_changes.iter_from(41).map(|it| it.cloned().collect::<Vec<_>>()),
16861686
);
16871687

1688-
assert_eq!(0, authority_set_changes.iter_from(121).unwrap().count(),);
1688+
assert_eq!(0, authority_set_changes.iter_from(121).unwrap().count());
16891689

1690-
assert_eq!(0, authority_set_changes.iter_from(200).unwrap().count(),);
1690+
assert_eq!(0, authority_set_changes.iter_from(200).unwrap().count());
16911691
}
16921692
}

0 commit comments

Comments
 (0)