Skip to content

Commit

Permalink
Make cargo clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Aug 21, 2023
1 parent 75b41b4 commit 3c51587
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pallets/phala/src/compute/stake_pool_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ pub mod pallet {
// this nft's property shouldn't be accessed or wrote again from storage before set_nft_attr
// is called. Or the property of the nft will be overwrote incorrectly.
let mut nft_guard =
base_pool::Pallet::<T>::get_nft_attr_guard(pool_info.basepool.cid, nft_id.into())?;
base_pool::Pallet::<T>::get_nft_attr_guard(pool_info.basepool.cid, nft_id)?;
let nft = &mut nft_guard.attr;
let in_queue_shares = match pool_info
.basepool
Expand Down
6 changes: 3 additions & 3 deletions standalone/prb/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ impl TxManager {
let id = ids.get(idx).ok_or(UnknownDataMismatch)?;
let tx = self.clone().tx_map.get(id).ok_or(UnknownDataMismatch)?;
let mut tx = tx.lock().await;
let shot = std::mem::replace(&mut tx.shot, None).ok_or(UnknownDataMismatch)?;
let shot = tx.shot.take().ok_or(UnknownDataMismatch)?;
tx.state = match &r {
Ok(_) => TransactionState::Success(TransactionSuccess::default()),
Err(e) => TransactionState::Error(e.into()),
Expand All @@ -375,7 +375,7 @@ impl TxManager {
for id in ids {
let tx = self.clone().tx_map.get(&id).ok_or(UnknownDataMismatch)?;
let mut tx = tx.lock().await;
let shot = std::mem::replace(&mut tx.shot, None).ok_or(UnknownDataMismatch)?;
let shot = tx.shot.take().ok_or(UnknownDataMismatch)?;
tx.state = TransactionState::Error((&e).into());
if shot.send(Err(anyhow!(e.to_string()))).is_err() {
return Err(anyhow!("shot can't be sent"));
Expand All @@ -397,7 +397,7 @@ impl TxManager {
for i in ids.iter() {
let tx = self.tx_map.get(i).ok_or(UnknownDataMismatch)?;
let mut tx = tx.lock().await;
let call = std::mem::replace(&mut tx.tx_payload, None).ok_or(UnknownDataMismatch)?;
let call = tx.tx_payload.take().ok_or(UnknownDataMismatch)?;
calls.push(call);
drop(tx);
}
Expand Down

0 comments on commit 3c51587

Please sign in to comment.