Skip to content

Commit 3b13853

Browse files
committed
f - remove unnecessary TryFrom
1 parent d1a7014 commit 3b13853

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

lightning/src/offers/offer.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,6 @@ impl Writeable for OfferContents {
394394
}
395395
}
396396

397-
impl TryFrom<Vec<u8>> for Offer {
398-
type Error = ParseError;
399-
400-
fn try_from(bytes: Vec<u8>) -> Result<Self, Self::Error> {
401-
let parsed_message = ParsedMessage::<OfferTlvStream>::try_from(bytes)?;
402-
Offer::try_from(parsed_message)
403-
}
404-
}
405-
406397
/// The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
407398
/// another currency.
408399
#[derive(Clone, Debug, PartialEq)]
@@ -475,10 +466,11 @@ impl FromStr for Offer {
475466
}
476467
}
477468

478-
impl TryFrom<ParsedMessage<OfferTlvStream>> for Offer {
469+
impl TryFrom<Vec<u8>> for Offer {
479470
type Error = ParseError;
480471

481-
fn try_from(offer: ParsedMessage<OfferTlvStream>) -> Result<Self, Self::Error> {
472+
fn try_from(bytes: Vec<u8>) -> Result<Self, Self::Error> {
473+
let offer = ParsedMessage::<OfferTlvStream>::try_from(bytes)?;
482474
let ParsedMessage { bytes, tlv_stream } = offer;
483475
let contents = OfferContents::try_from(tlv_stream)?;
484476
Ok(Offer { bytes, contents })

0 commit comments

Comments
 (0)