cargo fmt

This commit is contained in:
Michael Vines
2019-12-20 19:52:12 -08:00
parent 9815dcc159
commit 0c2f002774

View File

@ -727,32 +727,30 @@ fn main() {
} }
}); });
} }
("bounds", Some(args_matches)) => { ("bounds", Some(args_matches)) => match blocktree.slot_meta_iterator(0) {
match blocktree.slot_meta_iterator(0) { Ok(metas) => {
Ok(metas) => { let all = args_matches.is_present("all");
let all = args_matches.is_present("all");
println!("Collecting Ledger information..."); println!("Collecting Ledger information...");
let slots: Vec<_> = metas.map(|(slot, _)| slot).collect(); let slots: Vec<_> = metas.map(|(slot, _)| slot).collect();
if slots.is_empty() { if slots.is_empty() {
println!("Ledger is empty. No slots found."); println!("Ledger is empty. No slots found.");
} else { } else {
let first = slots.first().unwrap(); let first = slots.first().unwrap();
let last = slots.last().unwrap_or_else(|| first); let last = slots.last().unwrap_or_else(|| first);
if first != last { if first != last {
println!("Ledger contains data from slots {:?} to {:?}", first, last); println!("Ledger contains data from slots {:?} to {:?}", first, last);
if all { if all {
println!("Non-empty slots: {:?}", slots); println!("Non-empty slots: {:?}", slots);
}
} else {
println!("Ledger only contains some data for slot {:?}", first);
} }
} else {
println!("Ledger only contains some data for slot {:?}", first);
} }
} }
Err(err) => { }
eprintln!("Unable to read the Ledger: {:?}", err); Err(err) => {
exit(1); eprintln!("Unable to read the Ledger: {:?}", err);
} exit(1);
} }
}, },
("", _) => { ("", _) => {