From 560a709faac9ca8a49d62de1a92e68012d668174 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Mon, 24 Jun 2019 17:49:20 +0100 Subject: [PATCH] Add OutPoint::new() for one-liner construction (#285) --- src/blockdata/transaction.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/blockdata/transaction.rs b/src/blockdata/transaction.rs index dbe1b11..e82aab7 100644 --- a/src/blockdata/transaction.rs +++ b/src/blockdata/transaction.rs @@ -48,6 +48,15 @@ pub struct OutPoint { serde_struct_impl!(OutPoint, txid, vout); impl OutPoint { + /// Create a new [OutPoint]. + #[inline] + pub fn new(txid: sha256d::Hash, vout: u32) -> OutPoint { + OutPoint { + txid: txid, + vout: vout, + } + } + /// Creates a "null" `OutPoint`. /// /// This value is used for coinbase transactions because they don't have