Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions bitcoin/src/merkle_tree/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,12 @@ impl<'a> Arbitrary<'a> for MerkleBlock {

#[cfg(test)]
mod tests {
use hex::{DisplayHex, FromHex};
use hex_lit::hex;
#[cfg(feature = "std")]
use core::cmp;

use hex::{DisplayHex, FromHex};
use hex_lit::hex;

use super::*;
use crate::block::Unchecked;
use crate::consensus::encode;
Expand All @@ -555,11 +556,7 @@ mod tests {
const P: usize = 1039;
const Q: usize = 677;

const fn new(seed: usize) -> Self {
Self {
state: seed
}
}
const fn new(seed: usize) -> Self { Self { state: seed } }

#[inline]
fn next_usize(&mut self) -> usize {
Expand All @@ -568,14 +565,10 @@ mod tests {
}

#[inline]
fn next_in_range(&mut self, max: usize) -> usize {
self.next_usize() % max
}
fn next_in_range(&mut self, max: usize) -> usize { self.next_usize() % max }

#[inline]
fn next_u8(&mut self) -> u8 {
self.next_usize().to_le_bytes()[0]
}
fn next_u8(&mut self) -> u8 { self.next_usize().to_le_bytes()[0] }
}

#[cfg(feature = "std")]
Expand Down
2 changes: 1 addition & 1 deletion network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub mod as_core_arg {
#![allow(clippy::missing_errors_doc)]

use crate::Network;

#[allow(clippy::trivially_copy_pass_by_ref)] // `serde` controls the API.
pub fn serialize<S>(network: &Network, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down