Groom ledger-tool bounds output (#8710) (#8715)

(cherry picked from commit acb23e8ef0)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2020-03-07 14:15:50 -07:00
committed by GitHub
parent 67216ac7f5
commit 9d1c8657e2

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);
}
}
}