From 2bd71c37487c70a08e5c7d8a5eaed235230d293e Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Tue, 22 Feb 2022 18:56:13 +0000 Subject: [PATCH] Remove From for u32 We have conversion functions that include suffixes `_consensus` and `_standard` to make it explicit what guarantees are provided by the returned `u32` value. The `From` implementation reduces the clarity of the API. --- src/blockdata/transaction.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/blockdata/transaction.rs b/src/blockdata/transaction.rs index a84bcac5..224d90d4 100644 --- a/src/blockdata/transaction.rs +++ b/src/blockdata/transaction.rs @@ -859,12 +859,6 @@ impl EcdsaSigHashType { pub fn as_u32(self) -> u32 { self as u32 } } -impl From for u32 { - fn from(t: EcdsaSigHashType) -> u32 { - t.as_u32() - } -} - /// Error returned when parsing `SigHashType` fails. /// /// This is currently returned for unrecognized sighash strings.