|
@@ -14,23 +14,26 @@ fn main() {
|
|
|
serde_json::from_reader(bridgedb_infile).unwrap()
|
|
|
} else {
|
|
|
// create new bridgedb (implicitly generates keys)
|
|
|
- BridgeDb::new()
|
|
|
- };
|
|
|
+ let bridgedb = BridgeDb::new();
|
|
|
+
|
|
|
+ // output full serialized bridgedb
|
|
|
+ let mut bridgedb_outfile =
|
|
|
+ File::create(bridgedb_outfile_name).expect("Failed to create bridgedb.json");
|
|
|
+ let bridgedb_outfile_json = serde_json::to_string(&bridgedb).unwrap();
|
|
|
+ write!(bridgedb_outfile, "{}", bridgedb_outfile_json)
|
|
|
+ .expect("Failed to write to bridgedb.json");
|
|
|
|
|
|
- // output full serialized bridgedb
|
|
|
- let mut bridgedb_outfile =
|
|
|
- File::create(bridgedb_outfile_name).expect("Failed to create bridgedb.json");
|
|
|
- let bridgedb_outfile_json = serde_json::to_string(&bridgedb).unwrap();
|
|
|
- write!(bridgedb_outfile, "{}", bridgedb_outfile_json)
|
|
|
- .expect("Failed to write to bridgedb.json");
|
|
|
+ // output bridgedb public key
|
|
|
+ let mut bridgedb_pubkey_outfile =
|
|
|
+ File::create("bridgedb_pubkey.json").expect("Failed to create bridgedb_pubkey.json");
|
|
|
+ write!(
|
|
|
+ bridgedb_pubkey_outfile,
|
|
|
+ "{}",
|
|
|
+ serde_json::to_string(&bridgedb.pubkey).unwrap()
|
|
|
+ )
|
|
|
+ .expect("Failed to write to bridgedb_pubkey.json");
|
|
|
|
|
|
- // output bridgedb public key
|
|
|
- let mut bridgedb_pubkey_outfile =
|
|
|
- File::create("bridgedb_pubkey.json").expect("Failed to create bridgedb_pubkey.json");
|
|
|
- write!(
|
|
|
- bridgedb_pubkey_outfile,
|
|
|
- "{}",
|
|
|
- serde_json::to_string(&bridgedb.pubkey).unwrap()
|
|
|
- )
|
|
|
- .expect("Failed to write to bridgedb_pubkey.json");
|
|
|
+ // return bridgedb
|
|
|
+ bridgedb
|
|
|
+ };
|
|
|
}
|