diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-01-02 21:10:55 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-01-02 21:10:55 +0100 |
commit | 16a56f12cd2e66e10f8bb5e2c4026d3a7148e680 (patch) | |
tree | 913bd32a563b32302c2e14304460a3cbc9a88a39 /examples/zot/abook.rs | |
parent | 7f306445cb78d52f598eca1810dc2c5002e34a4a (diff) | |
download | rust-zotapi-16a56f12cd2e66e10f8bb5e2c4026d3a7148e680.tar.gz rust-zotapi-16a56f12cd2e66e10f8bb5e2c4026d3a7148e680.tar.bz2 rust-zotapi-16a56f12cd2e66e10f8bb5e2c4026d3a7148e680.zip |
Cargo fmt
Diffstat (limited to 'examples/zot/abook.rs')
-rw-r--r-- | examples/zot/abook.rs | 15 |
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); } |