Adding rustfmt_skip and fixing couple of places that have troubles after formatting.

This commit is contained in:
Tomusdrw 2016-02-16 10:42:56 +01:00
parent 771bcb5bda
commit 22e2458ce5
5 changed files with 26 additions and 23 deletions

View File

@ -29,6 +29,7 @@
// Floor[(CacheSizeBytesInit + CacheGrowth * j) / HashBytes]}, // Floor[(CacheSizeBytesInit + CacheGrowth * j) / HashBytes]},
// While[! PrimeQ[i], i--]; // While[! PrimeQ[i], i--];
// Sow[i*HashBytes]; j++]]]][[2]][[1]] // Sow[i*HashBytes]; j++]]]][[2]][[1]]
#[cfg_attr(rustfmt, rustfmt_skip)]
pub const DAG_SIZES: [u64; 2048] = [ pub const DAG_SIZES: [u64; 2048] = [
1073739904u64, 1082130304u64, 1090514816u64, 1098906752u64, 1107293056u64, 1073739904u64, 1082130304u64, 1090514816u64, 1098906752u64, 1107293056u64,
1115684224u64, 1124070016u64, 1132461952u64, 1140849536u64, 1149232768u64, 1115684224u64, 1124070016u64, 1132461952u64, 1140849536u64, 1149232768u64,
@ -456,6 +457,7 @@ pub const DAG_SIZES: [u64; 2048] = [
// Module[{i = Floor[(DataSetSizeBytesInit + DataSetGrowth * j) / (CacheMultiplier * HashBytes)]}, // Module[{i = Floor[(DataSetSizeBytesInit + DataSetGrowth * j) / (CacheMultiplier * HashBytes)]},
// While[! PrimeQ[i], i--]; // While[! PrimeQ[i], i--];
// Sow[i*HashBytes]; j++]]]][[2]][[1]] // Sow[i*HashBytes]; j++]]]][[2]][[1]]
#[cfg_attr(rustfmt, rustfmt_skip)]
pub const CACHE_SIZES: [u64; 2048] = [ pub const CACHE_SIZES: [u64; 2048] = [
16776896u64, 16907456u64, 17039296u64, 17170112u64, 17301056u64, 17432512u64, 17563072u64, 16776896u64, 16907456u64, 17039296u64, 17170112u64, 17301056u64, 17432512u64, 17563072u64,
17693888u64, 17824192u64, 17955904u64, 18087488u64, 18218176u64, 18349504u64, 18481088u64, 17693888u64, 17824192u64, 17955904u64, 18087488u64, 18218176u64, 18349504u64, 18481088u64,

View File

@ -137,6 +137,7 @@ impl InstructionInfo {
} }
} }
#[cfg_attr(rustfmt, rustfmt_skip)]
/// Return details about specific instruction /// Return details about specific instruction
pub fn get_info (instruction: Instruction) -> InstructionInfo { pub fn get_info (instruction: Instruction) -> InstructionInfo {
match instruction { match instruction {

View File

@ -202,7 +202,7 @@ pub mod ec {
match context.verify(&try!(Message::from_slice(&message)), &sig, &publ) { match context.verify(&try!(Message::from_slice(&message)), &sig, &publ) {
Ok(_) => Ok(true), Ok(_) => Ok(true),
Err(Error::IncorrectSignature) => Ok(false), Err(Error::IncorrectSignature) => Ok(false),
Err(x) => Err(<CryptoError as From<Error>>::from(x)) Err(x) => Err(CryptoError::from(x))
} }
} }

View File

@ -153,7 +153,7 @@ impl<'a, 'view> Iterator for RlpIterator<'a, 'view> {
fn next(&mut self) -> Option<Rlp<'a>> { fn next(&mut self) -> Option<Rlp<'a>> {
let index = self.index; let index = self.index;
let result = self.rlp.rlp.at(index).ok().map(| iter | { From::from(iter) }); let result = self.rlp.rlp.at(index).ok().map(From::from);
self.index += 1; self.index += 1;
result result
} }

View File

@ -1129,7 +1129,7 @@ mod tests {
assert_eq!(U256::from(105u8) / U256::from(5u8), U256::from(21u8)); assert_eq!(U256::from(105u8) / U256::from(5u8), U256::from(21u8));
let div = mult / U256::from(300u16); let div = mult / U256::from(300u16);
assert_eq!(div, U256([0x9F30411021524112u64, 0x0001BD5B7DDFBD5A, 0, 0])); assert_eq!(div, U256([0x9F30411021524112u64, 0x0001BD5B7DDFBD5A, 0, 0]));
//// TODO: bit inversion // TODO: bit inversion
} }
#[test] #[test]