fix some indentation: spaces -> tabs

This commit is contained in:
Maximilian Krüger 2018-02-16 09:34:52 +01:00
parent 1d5a5416d3
commit fc6e7df377
2 changed files with 26 additions and 26 deletions

View File

@ -254,19 +254,19 @@ fn uint256_pow_overflow_panic() {
#[test] #[test]
fn should_format_and_debug_correctly() { fn should_format_and_debug_correctly() {
let test = |x: usize, hex: &'static str, display: &'static str| { let test = |x: usize, hex: &'static str, display: &'static str| {
assert_eq!(format!("{}", U256::from(x)), display); assert_eq!(format!("{}", U256::from(x)), display);
assert_eq!(format!("{:?}", U256::from(x)), format!("0x{}", hex)); assert_eq!(format!("{:?}", U256::from(x)), format!("0x{}", hex));
assert_eq!(format!("{:x}", U256::from(x)), hex); assert_eq!(format!("{:x}", U256::from(x)), hex);
}; };
test(0x1, "1", "1"); test(0x1, "1", "1");
test(0xf, "f", "15"); test(0xf, "f", "15");
test(0x10, "10", "16"); test(0x10, "10", "16");
test(0xff, "ff", "255"); test(0xff, "ff", "255");
test(0x100, "100", "256"); test(0x100, "100", "256");
test(0xfff, "fff", "4095"); test(0xfff, "fff", "4095");
test(0x1000, "1000", "4096"); test(0x1000, "1000", "4096");
} }
#[test] #[test]
@ -422,9 +422,9 @@ fn uint256_mul() {
#[test] #[test]
fn uint256_div() { fn uint256_div() {
assert_eq!(U256::from(10u64) / U256::from(1u64), U256::from(10u64)); assert_eq!(U256::from(10u64) / U256::from(1u64), U256::from(10u64));
assert_eq!(U256::from(10u64) / U256::from(2u64), U256::from(5u64)); assert_eq!(U256::from(10u64) / U256::from(2u64), U256::from(5u64));
assert_eq!(U256::from(10u64) / U256::from(3u64), U256::from(3u64)); assert_eq!(U256::from(10u64) / U256::from(3u64), U256::from(3u64));
} }
#[test] #[test]
@ -797,10 +797,10 @@ fn u256_multi_full_mul() {
assert_eq!(U512([1, 0, 0, MAX-1, MAX, MAX, 0, 0]), result); assert_eq!(U512([1, 0, 0, MAX-1, MAX, MAX, 0, 0]), result);
let result = U256([MAX, MAX, MAX, 0]).full_mul(U256([MAX, MAX, MAX, MAX])); let result = U256([MAX, MAX, MAX, 0]).full_mul(U256([MAX, MAX, MAX, MAX]));
assert_eq!(U512([1, 0, 0, MAX, MAX-1, MAX, MAX, 0]), result); assert_eq!(U512([1, 0, 0, MAX, MAX-1, MAX, MAX, 0]), result);
let result = U256([MAX, MAX, MAX, MAX]).full_mul(U256([MAX, MAX, MAX, 0])); let result = U256([MAX, MAX, MAX, MAX]).full_mul(U256([MAX, MAX, MAX, 0]));
assert_eq!(U512([1, 0, 0, MAX, MAX-1, MAX, MAX, 0]), result); assert_eq!(U512([1, 0, 0, MAX, MAX-1, MAX, MAX, 0]), result);
let result = U256([MAX, MAX, MAX, MAX]).full_mul(U256([MAX, MAX, MAX, MAX])); let result = U256([MAX, MAX, MAX, MAX]).full_mul(U256([MAX, MAX, MAX, MAX]));
assert_eq!(U512([1, 0, 0, 0, MAX-1, MAX, MAX, MAX]), result); assert_eq!(U512([1, 0, 0, 0, MAX-1, MAX, MAX, MAX]), result);

View File

@ -10,7 +10,7 @@
// Rust Bitcoin Library // Rust Bitcoin Library
// Written in 2014 by // Written in 2014 by
// Andrew Poelstra <apoelstra@wpsoftware.net> // Andrew Poelstra <apoelstra@wpsoftware.net>
// //
// To the extent possible under law, the author(s) have dedicated all // To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to // copyright and related and neighboring rights to this software to
@ -399,7 +399,7 @@ macro_rules! uint_overflowing_mul {
2: 2:
" "
: /* $0 */ "={r8}"(result[0]), /* $1 */ "={r9}"(result[1]), /* $2 */ "={r10}"(result[2]), : /* $0 */ "={r8}"(result[0]), /* $1 */ "={r9}"(result[1]), /* $2 */ "={r10}"(result[2]),
/* $3 */ "={r11}"(result[3]), /* $4 */ "={rcx}"(overflow) /* $3 */ "={r11}"(result[3]), /* $4 */ "={rcx}"(overflow)
: /* $5 */ "m"(self_t[0]), /* $6 */ "m"(self_t[1]), /* $7 */ "m"(self_t[2]), : /* $5 */ "m"(self_t[0]), /* $6 */ "m"(self_t[1]), /* $7 */ "m"(self_t[2]),
/* $8 */ "m"(self_t[3]), /* $9 */ "m"(other_t[0]), /* $10 */ "m"(other_t[1]), /* $8 */ "m"(self_t[3]), /* $9 */ "m"(other_t[0]), /* $10 */ "m"(other_t[1]),
@ -897,11 +897,11 @@ macro_rules! construct_uint {
/// Negation with overflow. /// Negation with overflow.
pub fn overflowing_neg(self) -> ($name, bool) { pub fn overflowing_neg(self) -> ($name, bool) {
if self.is_zero() { if self.is_zero() {
(self, false) (self, false)
} else { } else {
(!self, true) (!self, true)
} }
} }
/// Checked negation. Returns `None` unless `self == 0`. /// Checked negation. Returns `None` unless `self == 0`.
@ -914,9 +914,9 @@ macro_rules! construct_uint {
/// Multiplication by u32 /// Multiplication by u32
#[deprecated(note = "Use Mul<u32> instead.")] #[deprecated(note = "Use Mul<u32> instead.")]
pub fn mul_u32(self, other: u32) -> Self { pub fn mul_u32(self, other: u32) -> Self {
self * other self * other
} }
/// Overflowing multiplication by u32 /// Overflowing multiplication by u32
#[allow(dead_code)] // not used when multiplied with inline assembly #[allow(dead_code)] // not used when multiplied with inline assembly