Skip to content

Commit deee085

Browse files
committed
Deserialize consensus objects using Read type
The BufReader wrapping is no longer needed after the rust-bitcoin `0.32.4` release which contains the standardisation of the trait bounds for deserialization to `Read` instead of `BufReader`.
1 parent 6ac2cf3 commit deee085

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lightning/src/util/ser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,8 +1625,7 @@ macro_rules! impl_consensus_ser {
16251625

16261626
impl Readable for $bitcoin_type {
16271627
fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
1628-
let mut reader = BufReader::<_>::new(r);
1629-
match consensus::encode::Decodable::consensus_decode(&mut reader) {
1628+
match consensus::encode::Decodable::consensus_decode(r) {
16301629
Ok(t) => Ok(t),
16311630
Err(consensus::encode::Error::Io(ref e))
16321631
if e.kind() == io::ErrorKind::UnexpectedEof =>

0 commit comments

Comments
 (0)