Merge rust-bitcoin/rust-bitcoin#3138: Manually format
191897f9ea
Manually format (Tobin C. Harding) Pull request description: Run `rustfmt` and manually fix the places where comments are moved to the wrong place. ACKs for top commit: Kixunil: ACK191897f9ea
apoelstra: ACK191897f9ea
successfully ran local tests Tree-SHA512: f977ff373d1d410012734208c090bfcd8f9dbda414d0b19400acf8f552df481b4a2bc20d77c61538895a6fb66197be13cbdadf74956d67fd4d055b99ba8ab356
This commit is contained in:
commit
5a53cfe81f
|
@ -113,7 +113,8 @@ impl ScriptBuf {
|
|||
self.0.push((n % 0x100) as u8);
|
||||
self.0.push((n / 0x100) as u8);
|
||||
}
|
||||
n => { // `PushBytes` enforces len < 0x100000000
|
||||
// `PushBytes` enforces len < 0x100000000
|
||||
n => {
|
||||
self.0.push(opcodes::Ordinary::OP_PUSHDATA4.to_u8());
|
||||
self.0.push((n % 0x100) as u8);
|
||||
self.0.push(((n / 0x100) % 0x100) as u8);
|
||||
|
|
|
@ -197,7 +197,6 @@ macro_rules! hash_type {
|
|||
<Self as crate::GeneralHash>::hash_byte_chunks(byte_slices)
|
||||
}
|
||||
|
||||
|
||||
/// Hashes the entire contents of the `reader`.
|
||||
#[cfg(feature = "bitcoin-io")]
|
||||
pub fn hash_reader<R: io::BufRead>(reader: &mut R) -> Result<Self, io::Error> {
|
||||
|
|
|
@ -247,8 +247,9 @@ pub trait GeneralHash: Hash {
|
|||
let bytes = reader.fill_buf()?;
|
||||
|
||||
let read = bytes.len();
|
||||
if read == 0 { // Empty slice means EOF.
|
||||
break
|
||||
// Empty slice means EOF.
|
||||
if read == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
engine.input(bytes);
|
||||
|
@ -352,9 +353,6 @@ mod tests {
|
|||
#[test]
|
||||
fn hash_reader() {
|
||||
let mut reader: &[u8] = b"hello";
|
||||
assert_eq!(
|
||||
sha256::Hash::hash_reader(&mut reader).unwrap(),
|
||||
sha256::Hash::hash(b"hello"),
|
||||
)
|
||||
assert_eq!(sha256::Hash::hash_reader(&mut reader).unwrap(), sha256::Hash::hash(b"hello"),)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,8 +104,9 @@ where
|
|||
let bytes = reader.fill_buf()?;
|
||||
|
||||
let read = bytes.len();
|
||||
if read == 0 { // Empty slice means EOF.
|
||||
break
|
||||
// Empty slice means EOF.
|
||||
if read == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
engine.input(bytes);
|
||||
|
|
Loading…
Reference in New Issue