Skip to content

Commit

Permalink
fix beta channel clippy (MystenLabs#2861)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkuo authored Jun 30, 2022
1 parent f7882fa commit c7db29f
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ impl AuthorityAPI for ConfigurableBatchActionClient {
transaction: ConfirmationTransaction,
) -> Result<TransactionInfoResponse, SuiError> {
let state = self.state.clone();
let result = state.handle_confirmation_transaction(transaction).await;
result
state.handle_confirmation_transaction(transaction).await
}

async fn handle_consensus_transaction(
Expand Down Expand Up @@ -138,17 +137,15 @@ impl AuthorityAPI for ConfigurableBatchActionClient {
request: ObjectInfoRequest,
) -> Result<ObjectInfoResponse, SuiError> {
let state = self.state.clone();
let x = state.handle_object_info_request(request).await;
x
state.handle_object_info_request(request).await
}

/// Handle Object information requests for this account.
async fn handle_transaction_info_request(
&self,
request: TransactionInfoRequest,
) -> Result<TransactionInfoResponse, SuiError> {
let result = self.state.handle_transaction_info_request(request).await;
result
self.state.handle_transaction_info_request(request).await
}

/// Handle Batch information requests for this authority.
Expand Down
10 changes: 3 additions & 7 deletions crates/sui-core/src/authority_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,15 @@ impl AuthorityAPI for LocalAuthorityClient {
request: AccountInfoRequest,
) -> Result<AccountInfoResponse, SuiError> {
let state = self.state.clone();
let result = state.handle_account_info_request(request).await;
result
state.handle_account_info_request(request).await
}

async fn handle_object_info_request(
&self,
request: ObjectInfoRequest,
) -> Result<ObjectInfoResponse, SuiError> {
let state = self.state.clone();
let x = state.handle_object_info_request(request).await;
x
state.handle_object_info_request(request).await
}

/// Handle Object information requests for this account.
Expand All @@ -290,9 +288,7 @@ impl AuthorityAPI for LocalAuthorityClient {
request: TransactionInfoRequest,
) -> Result<TransactionInfoResponse, SuiError> {
let state = self.state.clone();

let result = state.handle_transaction_info_request(request).await;
result
state.handle_transaction_info_request(request).await
}

/// Handle Batch information requests for this authority.
Expand Down
7 changes: 3 additions & 4 deletions crates/sui-core/src/gateway_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,9 @@ where
return Ok(id);
}
}
return Err(anyhow!(
"No non-argument gas objects found with value >= budget {}",
budget
));
Err(anyhow!(
"No non-argument gas objects found with value >= budget {budget}"
))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub fn crate_object_move_transaction(
arguments,
GAS_VALUE_FOR_TESTING / 2,
),
&*secret,
secret,
)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/sui-core/src/unit_tests/move_integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ pub async fn build_and_try_publish_test_package(
let gas_object_ref = gas_object.unwrap().compute_object_reference();

let data = TransactionData::new_module(*sender, gas_object_ref, all_module_bytes, gas_budget);
let signature = Signature::new(&data, &*sender_key);
let signature = Signature::new(&data, sender_key);
let transaction = Transaction::new(data, signature);
send_and_confirm_transaction(authority, transaction)
.await
Expand Down
8 changes: 4 additions & 4 deletions crates/sui-json-rpc-api/src/rpc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,12 @@ impl TryFrom<&SuiParsedObject> for GasCoin {
SuiData::Package(_) => {}
}

return Err(SuiError::TypeError {
Err(SuiError::TypeError {
error: format!(
"Gas object type is not a gas coin: {:?}",
object.data.type_()
),
});
})
}
}

Expand All @@ -441,9 +441,9 @@ impl TryFrom<&SuiMoveStruct> for GasCoin {
}
_ => {}
}
return Err(SuiError::TypeError {
Err(SuiError::TypeError {
error: format!("Struct is not a gas coin: {move_struct:?}"),
});
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/sui-open-rpc-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn parse_rpc_method(trait_data: &mut syn::ItemTrait) -> Result<RpcDefinition, sy

let returns = match &method.sig.output {
syn::ReturnType::Default => None,
syn::ReturnType::Type(_, output) => extract_type_from(&*output, "RpcResult"),
syn::ReturnType::Type(_, output) => extract_type_from(output, "RpcResult"),
};
methods.push(Method {
name: method_name,
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-storage/src/event_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use flexstr::SharedStr;

/// One event pulled out from the EventStore
#[allow(unused)]
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct StoredEvent {
/// UTC timestamp in milliseconds
timestamp: u64,
Expand Down Expand Up @@ -62,7 +62,7 @@ pub struct StoredEvent {
/// Enum for different types of values returnable from events in the EventStore
// This is distinct from MoveValue because we want to explicitly represent (and translate)
// blobs and strings, allowing us to use more efficient representations.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum EventValue {
Move(MoveValue),
/// Efficient string representation, no allocation for small strings
Expand Down
7 changes: 3 additions & 4 deletions crates/sui/src/wallet_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,9 @@ impl WalletContext {
return Ok(o);
}
}
return Err(anyhow!(
"No non-argument gas objects found with value >= budget {}",
budget
));
Err(anyhow!(
"No non-argument gas objects found with value >= budget {budget}"
))
}
}

Expand Down

0 comments on commit c7db29f

Please sign in to comment.