Run rustfmt globally.

Using `$ cargo fmt` in the root. Closes #68.
This commit is contained in:
Paul Hauner
2018-11-04 15:35:00 +01:00
parent 7cc2800916
commit 900ffac5e0
43 changed files with 754 additions and 975 deletions

View File

@@ -1,19 +1,15 @@
extern crate types;
use types::{
ValidatorRecord,
ValidatorStatus,
};
use types::{ValidatorRecord, ValidatorStatus};
pub fn validator_is_active(v: &ValidatorRecord) -> bool {
v.status == ValidatorStatus::Active as u8
}
/// Returns the indicies of each active validator in a given vec of validators.
pub fn active_validator_indices(validators: &[ValidatorRecord])
-> Vec<usize>
{
validators.iter()
pub fn active_validator_indices(validators: &[ValidatorRecord]) -> Vec<usize> {
validators
.iter()
.enumerate()
.filter_map(|(i, validator)| {
if validator_is_active(&validator) {
@@ -21,8 +17,7 @@ pub fn active_validator_indices(validators: &[ValidatorRecord])
} else {
None
}
})
.collect()
}).collect()
}
#[cfg(test)]