aboutsummaryrefslogtreecommitdiffstats
path: root/examples/zot/abook.rs
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-01-02 21:10:55 +0100
committerHarald Eilertsen <haraldei@anduin.net>2020-01-02 21:10:55 +0100
commit16a56f12cd2e66e10f8bb5e2c4026d3a7148e680 (patch)
tree913bd32a563b32302c2e14304460a3cbc9a88a39 /examples/zot/abook.rs
parent7f306445cb78d52f598eca1810dc2c5002e34a4a (diff)
downloadrust-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.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);
}