Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Oct 24, 2023
1 parent b1e6667 commit 54feaa0
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() -> color_eyre::Result<()> {
if opts.json {
let serialized = serde_json::to_string_pretty(&db).unwrap();
println!("{serialized}");
} else {
} else {
db.print_summary();
}
}
Expand All @@ -50,18 +50,20 @@ fn main() -> color_eyre::Result<()> {
debug!("registry/chains");
debug!("reg_opts: {:?}", reg_opts);

let mut chains= db.registries.values().map(|reg| {
reg.rpc_endpoints.keys().cloned().collect::<Vec<String>>()
}).fold(Vec::new(),| mut acc, x | {
acc.extend(x);
acc
});
let mut chains = db
.registries
.values()
.map(|reg| reg.rpc_endpoints.keys().cloned().collect::<Vec<String>>())
.fold(Vec::new(), |mut acc, x| {
acc.extend(x);
acc
});
chains.sort();
chains.dedup();
if opts.json {
let serialized = serde_json::to_string_pretty(&chains).unwrap();
println!("{serialized}");
} else {
} else {
chains.iter().for_each(|chain| {
println!("{chain}");
})
Expand All @@ -83,9 +85,9 @@ fn main() -> color_eyre::Result<()> {
println!("OK, {reg_name} has been added to your local data.");
local_data.print_registries();
}
Err(e) => println!(
"Something went wrong while adding {reg_name} to your local data: {e:?}"
),
Err(e) => {
println!("Something went wrong while adding {reg_name} to your local data: {e:?}")
}
}
}
Err(e) => println!("Error adding your registry from {}: {e:?}", &reg_opts.url),
Expand All @@ -110,15 +112,14 @@ fn main() -> color_eyre::Result<()> {
process::exit(1);
}
}
}
// RegistrySubCommand::Enable(reg_opts) => {
// debug!("registry/enable");
// debug!("reg_opts: {:?}", reg_opts);
// }
// RegistrySubCommand::Remove(_) => {
// debug!("registry/remove");

// },
} // RegistrySubCommand::Enable(reg_opts) => {
// debug!("registry/enable");
// debug!("reg_opts: {:?}", reg_opts);
// }
// RegistrySubCommand::Remove(_) => {
// debug!("registry/remove");

// },
}
}

Expand Down

0 comments on commit 54feaa0

Please sign in to comment.