Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
cl0w committed Oct 8, 2024
1 parent 0f490ec commit 1408391
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pallets/conviction-voting/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,10 +1030,10 @@ fn errors_with_remove_vote_work() {
});
}
thread_local! {
static LAST_ON_VOTE_DATA: RefCell<Option<(u64, u8, AccountVote<u64>)>> = RefCell::new(None);
static LAST_ON_REMOVE_VOTE_DATA: RefCell<Option<(u64, u8, Option<bool>)>> = RefCell::new(None);
static LAST_LOCKED_IF_UNSUCCESSFUL_VOTE_DATA: RefCell<Option<(u64, u8)>> = RefCell::new(None);
static REMOVE_VOTE_LOCKED_AMOUNT: RefCell<Option<u64>> = RefCell::new(None);
static LAST_ON_VOTE_DATA: RefCell<Option<(u64, u8, AccountVote<u64>)>> = const { RefCell::new(None) };
static LAST_ON_REMOVE_VOTE_DATA: RefCell<Option<(u64, u8, Option<bool>)>> = const { RefCell::new(None) };
static LAST_LOCKED_IF_UNSUCCESSFUL_VOTE_DATA: RefCell<Option<(u64, u8)>> = const { RefCell::new(None) };
static REMOVE_VOTE_LOCKED_AMOUNT: RefCell<Option<u64>> = const { RefCell::new(None) };
}

pub struct HooksHandler;
Expand Down
4 changes: 1 addition & 3 deletions pallets/staking/src/integrations/conviction_voting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ where
}

fn locked_if_unsuccessful_vote(who: &T::AccountId, ref_index: ReferendumIndex) -> Option<Balance> {
let Some(position_id) = Pallet::<T>::get_user_position_id(who).ok()? else {
return None;
};
let position_id = Pallet::<T>::get_user_position_id(who).ok()??;

if let Some(vote) = ProcessedVotes::<T>::get(who, ref_index) {
return Some(vote.amount);
Expand Down

0 comments on commit 1408391

Please sign in to comment.