Skip to content

Commit 9647b08

Browse files
committed
Update consensus_decode to use Read trait bound
In both cases the impl had stricter requirments than the trait definition.
1 parent c32f754 commit 9647b08

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use bitcoin::consensus::encode::{
1818
};
1919
use bitcoin::hex::DisplayHex;
2020

21-
use crate::io::{self, BufRead, Write};
21+
use crate::io::{self, BufRead, Read, Write};
2222
use crate::prelude::*;
2323
use crate::serialize;
2424
use crate::serialize::{Deserialize, Serialize};
@@ -199,7 +199,7 @@ impl<Subtype> Decodable for ProprietaryKey<Subtype>
199199
where
200200
Subtype: Copy + From<u8> + Into<u8>,
201201
{
202-
fn consensus_decode<R: BufRead + ?Sized>(r: &mut R) -> Result<Self, consensus::Error> {
202+
fn consensus_decode<R: Read + ?Sized>(r: &mut R) -> Result<Self, consensus::Error> {
203203
let prefix = Vec::<u8>::consensus_decode(r)?;
204204
let subtype = Subtype::from(r.read_u8()?);
205205

src/v0/bitcoin/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use bitcoin::consensus::encode::{
1414
};
1515

1616
use super::serialize::{Deserialize, Serialize};
17-
use crate::io::{self, BufRead, Write};
17+
use crate::io::{self, BufRead, Read, Write};
1818
use crate::prelude::*;
1919
use crate::v0::bitcoin::Error;
2020

@@ -160,7 +160,7 @@ impl<Subtype> Decodable for ProprietaryKey<Subtype>
160160
where
161161
Subtype: Copy + From<u8> + Into<u8>,
162162
{
163-
fn consensus_decode<R: BufRead + ?Sized>(r: &mut R) -> Result<Self, encode::Error> {
163+
fn consensus_decode<R: Read + ?Sized>(r: &mut R) -> Result<Self, encode::Error> {
164164
let prefix = Vec::<u8>::consensus_decode(r)?;
165165
let subtype = Subtype::from(r.read_u8()?);
166166

0 commit comments

Comments
 (0)