Skip to content

Commit 7ae1aaa

Browse files
zdavenathanwhit
authored andcommitted
Get rid of some pointless pin_project stuff (paritytech#14212)
1 parent 7759913 commit 7ae1aaa

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/network/transactions/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ codec = { package = "parity-scale-codec", version = "3.2.2", features = ["derive
1818
futures = "0.3.21"
1919
libp2p = "0.51.3"
2020
log = "0.4.17"
21-
pin-project = "1.0.12"
2221
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../../utils/prometheus" }
2322
sc-network = { version = "0.10.0-dev", path = "../" }
2423
sc-network-common = { version = "0.10.0-dev", path = "../common" }

client/network/transactions/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,19 @@ impl Metrics {
9797
}
9898
}
9999

100-
#[pin_project::pin_project]
101100
struct PendingTransaction<H> {
102-
#[pin]
103101
validation: TransactionImportFuture,
104102
tx_hash: H,
105103
}
106104

105+
impl<H> Unpin for PendingTransaction<H> {}
106+
107107
impl<H: ExHashT> Future for PendingTransaction<H> {
108108
type Output = (H, TransactionImport);
109109

110-
fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {
111-
let mut this = self.project();
112-
113-
if let Poll::Ready(import_result) = Pin::new(&mut this.validation).poll_unpin(cx) {
114-
return Poll::Ready((this.tx_hash.clone(), import_result))
110+
fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {
111+
if let Poll::Ready(import_result) = self.validation.poll_unpin(cx) {
112+
return Poll::Ready((self.tx_hash.clone(), import_result))
115113
}
116114

117115
Poll::Pending

0 commit comments

Comments
 (0)