Merge pull request #805 from ethcore/rustfmt

Rustfmt.toml
This commit is contained in:
Marek Kotewicz 2016-03-25 10:39:59 +01:00
commit 2c2e8ef154
6 changed files with 41 additions and 13 deletions

View File

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

14
fmt.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
RUSTFMT="rustfmt --write-mode overwrite"
$RUSTFMT ./ethash/src/lib.rs
$RUSTFMT ./ethcore/src/lib.rs
$RUSTFMT ./evmjit/src/lib.rs
$RUSTFMT ./json/src/lib.rs
$RUSTFMT ./miner/src/lib.rs
$RUSTFMT ./parity/main.rs
$RUSTFMT ./rpc/src/lib.rs
$RUSTFMT ./sync/src/lib.rs
$RUSTFMT ./util/src/lib.rs

14
rustfmt.toml Normal file
View File

@ -0,0 +1,14 @@
verbose=false
max_width=150
ideal_width=120
tabs_spaces=4
fn_call_width=100
single_line_if_else=true
where_indent="Visual"
where_trailing_comma=true
chain_base_indent="Inherit"
chain_indent="Tabbed"
reorder_imports=true
format_strings=false
hard_tabs=true
wrap_match_arms=false

View File

@ -1 +0,0 @@
hard_tabs = true

View File

@ -208,7 +208,7 @@ pub mod ec {
match context.verify(&try!(Message::from_slice(&message)), &sig, &publ) {
Ok(_) => Ok(true),
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>> {
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;
result
}