Remove docs from witness version conversion functions

These docs do not add that much value, we do not typically bother
documenting `From` and `TryFrom` implementations because they are super
well known and its obvious from the function signature what is going on.
This commit is contained in:
Tobin C. Harding 2023-08-04 10:51:57 +10:00
parent 47d6d785cb
commit 52f2332383
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 0 additions and 2 deletions

View File

@ -156,14 +156,12 @@ impl<'a> TryFrom<Instruction<'a>> for WitnessVersion {
}
impl From<WitnessVersion> for bech32::u5 {
/// Converts [`WitnessVersion`] instance into corresponding Bech32(m) u5-value ([`bech32::u5`]).
fn from(version: WitnessVersion) -> Self {
bech32::u5::try_from_u8(version.to_num()).expect("WitnessVersion must be 0..=16")
}
}
impl From<WitnessVersion> for Opcode {
/// Converts [`WitnessVersion`] instance into corresponding Bitcoin scriptopcode (`OP_0`..`OP_16`).
fn from(version: WitnessVersion) -> Opcode {
match version {
WitnessVersion::V0 => OP_PUSHBYTES_0,