diff --git a/primitives/src/tx.rs b/primitives/src/tx.rs index b6cc8ade..9ca880e6 100644 --- a/primitives/src/tx.rs +++ b/primitives/src/tx.rs @@ -72,12 +72,14 @@ impl FromHex for Txid { pub struct Vout(u32); impl Vout { + #[inline] pub fn into_u32(self) -> u32 { self.0 } } impl FromStr for Vout { type Err = ParseIntError; + #[inline] fn from_str(s: &str) -> Result { s.parse().map(Self) } } @@ -92,12 +94,16 @@ pub struct Outpoint { } impl Outpoint { + #[inline] pub fn new(txid: Txid, vout: impl Into) -> Self { Self { txid, vout: vout.into(), } } + + #[inline] + pub fn vout_u32(self) -> u32 { self.vout.into_u32() } } #[derive(Clone, Eq, PartialEq, Debug, Display, From, Error)]