Run cargo fmt
We have formatting issues on master because we do not yet run the formatter in CI (PR is open). We are about to move the `address` module to `/src` which will require running the formatter. Run `cargo fmt` to fix formatting issues, no other changes.
This commit is contained in:
parent
0eff9eb94a
commit
6cc8b22f82
|
@ -16,9 +16,7 @@ macro_rules! impl_std_error {
|
|||
#[cfg(feature = "std")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
|
||||
impl std::error::Error for $type {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
Some(&self.$field)
|
||||
}
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { Some(&self.$field) }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -61,24 +61,21 @@ extern crate test;
|
|||
extern crate alloc;
|
||||
|
||||
// Re-export dependencies we control.
|
||||
pub use bitcoin_hashes as hashes;
|
||||
pub use secp256k1;
|
||||
pub use bech32;
|
||||
#[cfg(feature = "bitcoinconsensus")]
|
||||
pub use bitcoinconsensus;
|
||||
pub use {bech32, bitcoin_hashes as hashes, secp256k1};
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
#[macro_use]
|
||||
extern crate actual_serde as serde;
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
#[macro_use]
|
||||
mod test_macros;
|
||||
mod internal_macros;
|
||||
mod parse;
|
||||
#[cfg(feature = "serde")]
|
||||
mod serde_utils;
|
||||
mod parse;
|
||||
|
||||
#[macro_use]
|
||||
pub mod network;
|
||||
|
|
24
src/parse.rs
24
src/parse.rs
|
@ -1,8 +1,9 @@
|
|||
use crate::internal_macros::write_err;
|
||||
use crate::error::impl_std_error;
|
||||
use core::convert::TryFrom;
|
||||
use core::fmt;
|
||||
use core::str::FromStr;
|
||||
use core::convert::TryFrom;
|
||||
|
||||
use crate::error::impl_std_error;
|
||||
use crate::internal_macros::write_err;
|
||||
use crate::prelude::*;
|
||||
|
||||
/// Error with rich context returned when a string can't be parsed as an integer.
|
||||
|
@ -28,21 +29,15 @@ pub struct ParseIntError {
|
|||
|
||||
impl ParseIntError {
|
||||
/// Returns the input that was attempted to be parsed.
|
||||
pub fn input(&self) -> &str {
|
||||
&self.input
|
||||
}
|
||||
pub fn input(&self) -> &str { &self.input }
|
||||
}
|
||||
|
||||
impl From<ParseIntError> for core::num::ParseIntError {
|
||||
fn from(value: ParseIntError) -> Self {
|
||||
value.source
|
||||
}
|
||||
fn from(value: ParseIntError) -> Self { value.source }
|
||||
}
|
||||
|
||||
impl AsRef<core::num::ParseIntError> for ParseIntError {
|
||||
fn as_ref(&self) -> &core::num::ParseIntError {
|
||||
&self.source
|
||||
}
|
||||
fn as_ref(&self) -> &core::num::ParseIntError { &self.source }
|
||||
}
|
||||
|
||||
impl fmt::Display for ParseIntError {
|
||||
|
@ -55,7 +50,10 @@ impl fmt::Display for ParseIntError {
|
|||
|
||||
/// Not strictly neccessary but serves as a lint - avoids weird behavior if someone accidentally
|
||||
/// passes non-integer to the `parse()` function.
|
||||
pub(crate) trait Integer: FromStr<Err=core::num::ParseIntError> + TryFrom<i8> + Sized {}
|
||||
pub(crate) trait Integer:
|
||||
FromStr<Err = core::num::ParseIntError> + TryFrom<i8> + Sized
|
||||
{
|
||||
}
|
||||
|
||||
macro_rules! impl_integer {
|
||||
($($type:ty),* $(,)?) => {
|
||||
|
|
|
@ -235,9 +235,10 @@ pub mod hex_bytes {
|
|||
//! Module for serialization of byte arrays as hex strings.
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use crate::hashes::hex::{FromHex, ToHex};
|
||||
use serde;
|
||||
|
||||
use crate::hashes::hex::{FromHex, ToHex};
|
||||
|
||||
pub fn serialize<T, S>(bytes: &T, s: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
T: serde::Serialize + AsRef<[u8]>,
|
||||
|
|
Loading…
Reference in New Issue