Manually format

Run `rustfmt` and manually fix the places where comments are moved to
the wrong place.
This commit is contained in:
Tobin C. Harding 2024-08-08 09:38:45 +10:00
parent 000661360e
commit 191897f9ea
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
4 changed files with 9 additions and 10 deletions

View File

@ -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);

View File

@ -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> {

View File

@ -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"),)
}
}

View File

@ -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);