Skip to content

Commit

Permalink
Fix Clippy warnings on Rust 1.72
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Aug 25, 2023
1 parent 2af08a8 commit 00b8645
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions crates/relayer-cli/src/commands/tx/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ macro_rules! tx_chan_cmd {
Err(e) => Output::error(format!("{}", e)).exit(),
};

#[allow(clippy::redundant_closure_call)]
let channel = $chan(chains, dst_connection);

info!("message {}: {}", $dbg_string, channel);
Expand Down
1 change: 1 addition & 0 deletions crates/relayer-cli/src/commands/tx/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ macro_rules! conn_open_cmd {
Err(e) => Output::error(format!("{}", e)).exit(),
};

#[allow(clippy::redundant_closure_call)]
let connection = $conn(chains);

debug!("message {}: {:?}", $dbg_string, connection);
Expand Down
2 changes: 1 addition & 1 deletion crates/relayer/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ mod tests {

// NOTE(new): Add tests here

assert!(matches!(parse("hello-world"), Err(_)));
assert!(parse("hello-world").is_err());
}
}
1 change: 0 additions & 1 deletion crates/relayer/src/chain/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ impl CosmosSdkChain {
))?;

// TODO - Verify response proof, if requested.
if prove {}

Ok(response)
}
Expand Down
5 changes: 2 additions & 3 deletions crates/relayer/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,8 @@ impl GrpcStatusSubdetail {
/// "account sequence mismatch, expected E, got G".
/// If a match is found it extracts and returns (E, G).
fn parse_sequences_in_mismatch_error_message(message: &str) -> Option<(u64, u64)> {
let re =
Regex::new(r#"account sequence mismatch, expected (?P<expected>\d+), got (?P<got>\d+)"#)
.unwrap();
let re = Regex::new(r"account sequence mismatch, expected (?P<expected>\d+), got (?P<got>\d+)")
.unwrap();
match re.captures(message) {
None => None,
Some(captures) => match (captures["expected"].parse(), captures["got"].parse()) {
Expand Down
5 changes: 4 additions & 1 deletion crates/relayer/src/link/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ impl<ChainA: ChainHandle, ChainB: ChainHandle> Link<ChainA, ChainB> {
self.a_to_b.src_chain(),
&self.a_to_b.path_id,
)
.map_err(LinkError::supervisor)? else { return Ok(vec![]) };
.map_err(LinkError::supervisor)?
else {
return Ok(vec![]);
};

if sequences.is_empty() {
return Ok(vec![]);
Expand Down
4 changes: 3 additions & 1 deletion crates/relayer/src/link/relay_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,9 @@ impl<ChainA: ChainHandle, ChainB: ChainHandle> RelayPath<ChainA, ChainB> {
unreceived_acknowledgements(self.dst_chain(), self.src_chain(), &self.path_id)
.map_err(LinkError::supervisor)?;

let Some((sequences, src_response_height)) = sequences_and_height else { return Ok(()) };
let Some((sequences, src_response_height)) = sequences_and_height else {
return Ok(());
};

let query_height = opt_query_height.unwrap_or(src_response_height);

Expand Down

0 comments on commit 00b8645

Please sign in to comment.