Groom ledger-tool bounds output (#8710)

This commit is contained in:
Michael Vines 2020-03-07 09:05:15 -07:00 committed by GitHub
parent f992ee3140
commit acb23e8ef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1093,20 +1093,19 @@ fn main() {
Ok(metas) => {
let all = arg_matches.is_present("all");
println!("Collecting Ledger information...");
let slots: Vec<_> = metas.map(|(slot, _)| slot).collect();
if slots.is_empty() {
println!("Ledger is empty. No slots found.");
println!("Ledger is empty");
} else {
let first = slots.first().unwrap();
let last = slots.last().unwrap_or_else(|| first);
if first != last {
println!("Ledger contains data from slots {:?} to {:?}", first, last);
println!("Ledger has data for slots {:?} to {:?}", first, last);
if all {
println!("Non-empty slots: {:?}", slots);
}
} else {
println!("Ledger only contains some data for slot {:?}", first);
println!("Ledger has data for slot {:?}", first);
}
}
}