Disable long lines formatting (#939)

This commit is contained in:
Tomasz Drwięga 2016-04-13 00:06:02 +02:00 committed by Gav Wood
parent fbc28ce493
commit 3ce2374aeb
3 changed files with 37 additions and 37 deletions

View File

@ -27,7 +27,7 @@ use std::ptr;
use sha3; use sha3;
use std::slice; use std::slice;
use std::path::PathBuf; use std::path::PathBuf;
use std::io::{Read, Write, self}; use std::io::{self, Read, Write};
use std::fs::{self, File}; use std::fs::{self, File};
pub const ETHASH_EPOCH_LENGTH: u64 = 30000; pub const ETHASH_EPOCH_LENGTH: u64 = 30000;
@ -51,7 +51,7 @@ pub struct ProofOfWork {
/// Difficulty boundary /// Difficulty boundary
pub value: H256, pub value: H256,
/// Mix /// Mix
pub mix_hash: H256 pub mix_hash: H256,
} }
struct Node { struct Node {
@ -148,14 +148,16 @@ impl Light {
pub struct SeedHashCompute { pub struct SeedHashCompute {
prev_epoch: Cell<u64>, prev_epoch: Cell<u64>,
prev_seedhash: Cell<H256> prev_seedhash: Cell<H256>,
} }
impl SeedHashCompute { impl SeedHashCompute {
#[inline] #[inline]
pub fn new() -> SeedHashCompute { pub fn new() -> SeedHashCompute {
SeedHashCompute { prev_epoch: Cell::new(0), prev_seedhash: Cell::new([0u8; 32]) } SeedHashCompute {
prev_epoch: Cell::new(0),
prev_seedhash: Cell::new([0u8; 32]),
}
} }
#[inline] #[inline]
@ -370,9 +372,7 @@ fn to_hex(bytes: &[u8]) -> String {
v.push(CHARS[(byte & 0xf) as usize]); v.push(CHARS[(byte & 0xf) as usize]);
} }
unsafe { unsafe { String::from_utf8_unchecked(v) }
String::from_utf8_unchecked(v)
}
} }
#[test] #[test]

View File

@ -24,7 +24,7 @@ mod compute;
use std::mem; use std::mem;
use compute::Light; use compute::Light;
pub use compute::{SeedHashCompute, quick_get_difficulty, H256, ProofOfWork, ETHASH_EPOCH_LENGTH}; pub use compute::{ETHASH_EPOCH_LENGTH, H256, ProofOfWork, SeedHashCompute, quick_get_difficulty};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -76,7 +76,7 @@ impl EthashManager {
lights.recent.clone() lights.recent.clone()
} }
_ => None, _ => None,
} },
}; };
match light { match light {
None => { None => {
@ -95,7 +95,7 @@ impl EthashManager {
lights.prev = mem::replace(&mut lights.recent, Some(light.clone())); lights.prev = mem::replace(&mut lights.recent, Some(light.clone()));
light light
} }
Some(light) => light Some(light) => light,
} }
}; };
light.compute(header_hash, nonce) light.compute(header_hash, nonce)

View File

@ -1,8 +1,8 @@
verbose=false verbose=false
max_width=150 max_width=1000
ideal_width=120 ideal_width=1000
tabs_spaces=4 tabs_spaces=4
fn_call_width=100 fn_call_width=1000
fn_arg_indent="Tabbed" fn_arg_indent="Tabbed"
single_line_if_else=true single_line_if_else=true
where_indent="Visual" where_indent="Visual"