aboutsummaryrefslogtreecommitdiffstats
path: root/examples/zot/abook.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/zot/abook.rs')
-rw-r--r--examples/zot/abook.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/zot/abook.rs b/examples/zot/abook.rs
index 7e91981..a16f68c 100644
--- a/examples/zot/abook.rs
+++ b/examples/zot/abook.rs
@@ -20,11 +20,10 @@ pub fn fetch(client: &zotapi::Client, raw: bool) {
Ok(payload) => {
if raw {
println!("{}", &payload);
- }
- else {
+ } else {
process(&payload);
}
- },
+ }
Err(e) => {
println!("{:?}", e);
}
@@ -36,12 +35,12 @@ fn process(payload: &str) {
match data {
serde_json::Value::Array(v) => {
for contact in v {
- println!("{} ({}, {})",
- contact["xchan_name"],
- contact["xchan_addr"],
- contact["xchan_network"]);
+ println!(
+ "{} ({}, {})",
+ contact["xchan_name"], contact["xchan_addr"], contact["xchan_network"]
+ );
}
- },
+ }
_ => {
println!("Unexpected data:\n{}", payload);
}