mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
Mark unreachable match clause as unreachable! (#620)
* Mark unreachable match clause as unreachable! * Fix indentation
This commit is contained in:
@@ -835,7 +835,13 @@ impl<C, TxApi> futures03::Future for CreateProposal<C, TxApi> where
|
|||||||
|
|
||||||
data
|
data
|
||||||
},
|
},
|
||||||
CreateProposalState::Switching => return Poll::Pending,
|
CreateProposalState::Switching =>
|
||||||
|
unreachable!(
|
||||||
|
"State Switching are only created on call, \
|
||||||
|
and immediately swapped out; \
|
||||||
|
the data being read is from state; \
|
||||||
|
thus Switching will never be reachable here; qed"
|
||||||
|
),
|
||||||
CreateProposalState::Fired(mut future) => {
|
CreateProposalState::Fired(mut future) => {
|
||||||
let ret = Pin::new(&mut future).poll(cx);
|
let ret = Pin::new(&mut future).poll(cx);
|
||||||
self.state = CreateProposalState::Fired(future);
|
self.state = CreateProposalState::Fired(future);
|
||||||
@@ -844,17 +850,14 @@ impl<C, TxApi> futures03::Future for CreateProposal<C, TxApi> where
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 2. propose
|
// 2. propose
|
||||||
let future = tokio_executor::blocking::run(move || {
|
let mut future = tokio_executor::blocking::run(move || {
|
||||||
let proposed_candidates = data.table.proposed_set();
|
let proposed_candidates = data.table.proposed_set();
|
||||||
data.propose_with(proposed_candidates)
|
data.propose_with(proposed_candidates)
|
||||||
});
|
});
|
||||||
|
let polled = Pin::new(&mut future).poll(cx);
|
||||||
self.state = CreateProposalState::Fired(future);
|
self.state = CreateProposalState::Fired(future);
|
||||||
|
|
||||||
match &mut self.state {
|
polled
|
||||||
CreateProposalState::Fired(future) => Pin::new(future).poll(cx),
|
|
||||||
CreateProposalState::Switching | CreateProposalState::Pending(_) =>
|
|
||||||
Poll::Pending,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user