Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2bd committed May 26, 2021
1 parent e6aef4d commit 31d3f9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions rust/fastpay/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,13 @@ impl MessageHandler for RunningServerState {
}

match reply {
Ok(x) => {
return x;
}
Ok(x) => x,
Err(error) => {
warn!("User query failed: {}", error);
self.server.user_errors += 1;
return Some(serialize_error(&error));
Some(serialize_error(&error))
}
};
}
})
}
}
Expand Down Expand Up @@ -280,7 +278,7 @@ impl Client {
buf: Vec<u8>,
) -> Result<AccountInfoResponse, FastPayError> {
match self.send_recv_bytes_internal(shard, buf).await {
Err(error) => Err(FastPayError::ClientIOError {
Err(error) => Err(FastPayError::ClientIoError {
error: format!("{}", error),
}),
Ok(response) => {
Expand Down
2 changes: 1 addition & 1 deletion rust/fastpay_core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl AuthorityState {
) -> Result<&AccountOffchainState, FastPayError> {
self.accounts
.get(address)
.ok_or_else(|| FastPayError::UnknownSenderAccount)
.ok_or(FastPayError::UnknownSenderAccount)
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion rust/fastpay_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ pub enum FastPayError {
#[fail(display = "Unexpected message.")]
UnexpectedMessage,
#[fail(display = "Network error while querying service: {:?}.", error)]
ClientIOError { error: String },
ClientIoError { error: String },
}

0 comments on commit 31d3f9f

Please sign in to comment.