8000 Use conventional spacing for default type parameters by tcharding · Pull Request #880 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use conventional spacing for default type parameters #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
8 changes: 4 additions & 4 deletions src/util/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ pub trait CheckedSum<R>: private::SumSeal<R> {
fn checked_sum(self) -> Option<R>;
}

impl<T> CheckedSum<Amount> for T where T: Iterator<Item = Amount> {
impl<T> CheckedSum<Amount> for T where T: Iterator<Item=Amount> {
fn checked_sum(mut self) -> Option<Amount> {
let first = Some(self.next().unwrap_or_default());

Expand All @@ -957,7 +957,7 @@ impl<T> CheckedSum<Amount> for T where T: Iterator<Item = Amount> {
}
}

impl<T> CheckedSum<SignedAmount> for T where T: Iterator<Item = SignedAmount> {
impl<T> CheckedSum<SignedAmount> for T where T: Iterator<Item=SignedAmount> {
fn checked_sum(mut self) -> Option<SignedAmount> {
let first = Some(self.next().unwrap_or_default());

Expand All @@ -971,8 +971,8 @@ mod private {
/// Used to seal the `CheckedSum` trait
pub trait SumSeal<A> {}

impl<T> SumSeal<Amount> for T where T: Iterator<Item = Amount> {}
impl<T> SumSeal<SignedAmount> for T where T: Iterator<Item = SignedAmount> {}
impl<T> SumSeal<Amount> for T where T: Iterator<Item=Amount> {}
impl<T> SumSeal<SignedAmount> for T where T: Iterator<Item=SignedAmount> {}
}

#[cfg(feature = "serde")]
Expand Down
4 changes: 2 additions & 2 deletions src/util/base58.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub fn from_check(data: &str) -> Result<Vec<u8>, Error> {

fn format_iter<I, W>(writer: &mut W, data: I) -> Result<(), fmt::Error>
where
I: Iterator<Item = u8> + Clone,
I: Iterator<Item=u8> + Clone,
W: fmt::Write
{
let mut ret = SmallVec::new();
Expand Down Expand Up @@ -219,7 +219,7 @@ where

fn encode_iter<I>(data: I) -> String
where
I: Iterator<Item = u8> + Clone,
I: Iterator<Item=u8> + Clone,
{
let mut ret = String::new();
format_iter(&mut ret, data).expect("writing into string shouldn't fail");
Expand Down
2 changes: 1 addition & 1 deletion src/util/bip32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl<'a> From<&'a [ChildNumber]> for DerivationPath {
}

impl ::core::iter::FromIterator<ChildNumber> for DerivationPath {
fn from_iter<T>(iter: T) -> Self where T: IntoIterator<Item = ChildNumber> {
fn from_iter<T>(iter: T) -> Self where T: IntoIterator<Item=ChildNumber> {
DerivationPath(Vec::from_iter(iter))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn bitcoin_merkle_root<T, I>(mut hashes: I) -> Option<T>
where
T: Hash + Encodable,
<T as Hash>::Engine: io::Write,
I: Iterator<Item = T>,
I: Iterator<Item=T>,
{
let first = hashes.next()?;
let second = match hashes.next() {
Expand Down
2 changes: 1 addition & 1 deletion src/util/psbt/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub type ProprietaryType = u8;
/// structure according to BIP 174.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ProprietaryKey<Subtype = ProprietaryType> where Subtype: Copy + From<u8> + Into<u8> {
pub struct ProprietaryKey<Subtype=ProprietaryType> where Subtype: Copy + From<u8> + Into<u8> {
/// Proprietary type prefix used for grouping together keys under some
/// application and avoid namespace collision
#[cfg_attr(feature = "serde", serde(with = "::serde_utils::hex_bytes"))]
Expand Down
6 changes: 3 additions & 3 deletions src/util/sighash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use super::taproot::LeafVersion;

/// Efficiently calculates signature hash message for legacy, segwit and taproot inputs.
#[derive(Debug)]
pub struct SigHashCache<T: Deref<Target = Transaction>> {
pub struct SigHashCache<T: Deref<Target=Transaction>> {
/// Access to transaction required for various introspection, moreover type
/// `T: Deref<Target=Transaction>` allows to accept borrow and mutable borrow, the
/// latter in particular is necessary for [`SigHashCache::witness_mut`]
Expand Down Expand Up @@ -295,7 +295,7 @@ impl SchnorrSigHashType {
}
}

impl<R: Deref<Target = Transaction>> SigHashCache<R> {
impl<R: Deref<Target=Transaction>> SigHashCache<R> {
/// Compute the sighash components from an unsigned transaction and auxiliary
/// in a lazy manner when required.
/// For the generated sighashes to be valid, no fields in the transaction may change except for
Expand Down Expand Up @@ -692,7 +692,7 @@ impl<R: Deref<Target = Transaction>> SigHashCache<R> {
}
}

impl<R: DerefMut<Target = Transaction>> SigHashCache<R> {
impl<R: DerefMut<Target=Transaction>> SigHashCache<R> {
/// When the SigHashCache is initialized with a mutable reference to a transaction instead of a
/// regular reference, this method is available to allow modification to the witnesses.
///
Expand Down
2 changes: 1 addition & 1 deletion src/util/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl TaprootSpendInfo {
script_weights: I,
) -> Result<Self, TaprootBuilderError>
where
I: IntoIterator<Item = (u32, Script)>,
I: IntoIterator<Item=(u32, Script)>,
C: secp256k1::Verification,
{
let mut node_weights = BinaryHeap::<(Reverse<u64>, NodeInfo)>::new();
Expand Down
0