Fix unusual indentation
We have a few instances of strange indentation: - Incorrect number of characters - Usage of neither "Block" style or "View" style (elect to use "Block")
This commit is contained in:
parent
b9b6e7e1c6
commit
39ec59620d
|
@ -860,8 +860,8 @@ impl Ordinary {
|
||||||
/// Encode as a byte
|
/// Encode as a byte
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn into_u8(self) -> u8 {
|
pub fn into_u8(self) -> u8 {
|
||||||
self as u8
|
self as u8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -570,8 +570,8 @@ macro_rules! impl_vec {
|
||||||
fn consensus_decode<D: io::Read>(mut d: D) -> Result<Self, Error> {
|
fn consensus_decode<D: io::Read>(mut d: D) -> Result<Self, Error> {
|
||||||
let len = VarInt::consensus_decode(&mut d)?.0;
|
let len = VarInt::consensus_decode(&mut d)?.0;
|
||||||
let byte_size = (len as usize)
|
let byte_size = (len as usize)
|
||||||
.checked_mul(mem::size_of::<$type>())
|
.checked_mul(mem::size_of::<$type>())
|
||||||
.ok_or(self::Error::ParseFailed("Invalid length"))?;
|
.ok_or(self::Error::ParseFailed("Invalid length"))?;
|
||||||
if byte_size > MAX_VEC_SIZE {
|
if byte_size > MAX_VEC_SIZE {
|
||||||
return Err(self::Error::OversizedVectorAllocation { requested: byte_size, max: MAX_VEC_SIZE })
|
return Err(self::Error::OversizedVectorAllocation { requested: byte_size, max: MAX_VEC_SIZE })
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,10 +293,10 @@ mod tests {
|
||||||
// Addresses
|
// Addresses
|
||||||
let addr = Vec::from_hex("00f8917303bfa8ef24f292e8fa1419b20460ba064d").unwrap();
|
let addr = Vec::from_hex("00f8917303bfa8ef24f292e8fa1419b20460ba064d").unwrap();
|
||||||
assert_eq!(&check_encode_slice(&addr[..]), "1PfJpZsjreyVrqeoAfabrRwwjQyoSQMmHH");
|
assert_eq!(&check_encode_slice(&addr[..]), "1PfJpZsjreyVrqeoAfabrRwwjQyoSQMmHH");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_base58_decode() {
|
fn test_base58_decode() {
|
||||||
// Basics
|
// Basics
|
||||||
assert_eq!(from("1").ok(), Some(vec![0u8]));
|
assert_eq!(from("1").ok(), Some(vec![0u8]));
|
||||||
assert_eq!(from("2").ok(), Some(vec![1u8]));
|
assert_eq!(from("2").ok(), Some(vec![1u8]));
|
||||||
|
|
|
@ -486,11 +486,11 @@ impl fmt::Display for Error {
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
|
||||||
impl error::Error for Error {
|
impl error::Error for Error {
|
||||||
fn cause(&self) -> Option<&dyn error::Error> {
|
fn cause(&self) -> Option<&dyn error::Error> {
|
||||||
if let Error::Secp256k1(ref e) = *self {
|
if let Error::Secp256k1(ref e) = *self {
|
||||||
Some(e)
|
Some(e)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue