mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Further expand clippy workspace lints
Achieves a notable amount of reduced async and clones.
This commit is contained in:
@@ -307,12 +307,11 @@ impl Processor {
|
||||
block_number,
|
||||
},
|
||||
) => {
|
||||
let block = match id {
|
||||
SubstrateSignId {
|
||||
id: SubstrateSignableId::CosigningSubstrateBlock(block),
|
||||
..
|
||||
} => block,
|
||||
_ => panic!("CosignSubstrateBlock didn't have CosigningSubstrateBlock ID"),
|
||||
let SubstrateSignId {
|
||||
id: SubstrateSignableId::CosigningSubstrateBlock(block), ..
|
||||
} = id
|
||||
else {
|
||||
panic!("CosignSubstrateBlock didn't have CosigningSubstrateBlock ID")
|
||||
};
|
||||
|
||||
let new_cosign = CurrentCosign { block_number, block };
|
||||
|
||||
@@ -99,7 +99,7 @@ pub async fn batch(
|
||||
participants.insert(known_signer_i);
|
||||
participants
|
||||
}
|
||||
other => panic!("coordinator didn't send back SubstratePreprocesses: {:?}", other),
|
||||
other => panic!("coordinator didn't send back SubstratePreprocesses: {other:?}"),
|
||||
};
|
||||
|
||||
for i in participants.clone() {
|
||||
|
||||
@@ -70,8 +70,7 @@ pub fn build(name: String) {
|
||||
// Check any additionally specified paths
|
||||
let meta = |path: PathBuf| (path.clone(), fs::metadata(path));
|
||||
let mut metadatas = match name.as_str() {
|
||||
"bitcoin" => vec![],
|
||||
"monero" => vec![],
|
||||
"bitcoin" | "monero" => vec![],
|
||||
"message-queue" => vec![
|
||||
meta(repo_path.join("common")),
|
||||
meta(repo_path.join("crypto")),
|
||||
@@ -94,12 +93,7 @@ pub fn build(name: String) {
|
||||
meta(repo_path.join("message-queue")),
|
||||
meta(repo_path.join("coordinator")),
|
||||
],
|
||||
"runtime" => vec![
|
||||
meta(repo_path.join("common")),
|
||||
meta(repo_path.join("crypto")),
|
||||
meta(repo_path.join("substrate")),
|
||||
],
|
||||
"serai" => vec![
|
||||
"runtime" | "serai" => vec![
|
||||
meta(repo_path.join("common")),
|
||||
meta(repo_path.join("crypto")),
|
||||
meta(repo_path.join("substrate")),
|
||||
@@ -132,7 +126,7 @@ pub fn build(name: String) {
|
||||
|
||||
if let Some(last_modified) = last_modified {
|
||||
if last_modified < created_time {
|
||||
println!("{} was built after the most recent source code edits, assuming built.", name);
|
||||
println!("{name} was built after the most recent source code edits, assuming built.");
|
||||
built_lock.insert(name, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ async fn mint_and_burn_test() {
|
||||
),
|
||||
1_100_000_000_000,
|
||||
)],
|
||||
Change::new(&view_pair, false),
|
||||
&Change::new(&view_pair, false),
|
||||
vec![Shorthand::transfer(None, serai_addr).encode()],
|
||||
rpc.get_fee(Protocol::v16, FeePriority::Low).await.unwrap(),
|
||||
)
|
||||
|
||||
@@ -314,7 +314,7 @@ impl Coordinator {
|
||||
let res: Option<String> =
|
||||
rpc.rpc_call("submitblock", serde_json::json!([hex::encode(block)])).await.unwrap();
|
||||
if let Some(err) = res {
|
||||
panic!("submitblock failed: {}", err);
|
||||
panic!("submitblock failed: {err}");
|
||||
}
|
||||
}
|
||||
NetworkId::Ethereum => todo!(),
|
||||
|
||||
@@ -361,7 +361,7 @@ impl Wallet {
|
||||
None,
|
||||
these_inputs.drain(..).zip(decoys.drain(..)).collect(),
|
||||
vec![(to_addr, AMOUNT)],
|
||||
Change::new(view_pair, false),
|
||||
&Change::new(view_pair, false),
|
||||
data,
|
||||
rpc.get_fee(Protocol::v16, FeePriority::Low).await.unwrap(),
|
||||
)
|
||||
|
||||
@@ -96,6 +96,6 @@ pub fn reproducibly_builds() {
|
||||
for res in res.clone() {
|
||||
identical.insert(res.unwrap());
|
||||
}
|
||||
assert_eq!(identical.len(), 1, "got different runtime hashes {:?}", res);
|
||||
assert_eq!(identical.len(), 1, "got different runtime hashes {res:?}");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user