forked from ryzokuken/cosmoline
src: misc formatting fixes
This commit is contained in:
parent
f9fed6013d
commit
5ad54fd523
|
@ -1,6 +1,6 @@
|
|||
use async_std::{fs, task};
|
||||
use async_std::path::PathBuf;
|
||||
use async_std::sync::Arc;
|
||||
use async_std::{fs, task};
|
||||
use clap::{load_yaml, App};
|
||||
use ed25519_dalek::Keypair;
|
||||
|
||||
|
@ -9,8 +9,6 @@ use keypair::{SSBKeypair, SSBPublicKey};
|
|||
|
||||
mod network;
|
||||
|
||||
type Config = toml::map::Map<String, toml::Value>;
|
||||
|
||||
#[async_std::main]
|
||||
async fn main() {
|
||||
let options = load_yaml!("options.yaml");
|
||||
|
@ -26,7 +24,7 @@ async fn main() {
|
|||
),
|
||||
};
|
||||
let config = fs::read_to_string(config_file).await.unwrap();
|
||||
let config: Config = toml::from_str(config.as_str()).unwrap();
|
||||
let config: toml::map::Map<String, toml::Value> = toml::from_str(config.as_str()).unwrap();
|
||||
|
||||
let path = match options.value_of("path") {
|
||||
Some(path) => PathBuf::from(path),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use async_std::task;
|
||||
use async_std::net::{IpAddr, UdpSocket};
|
||||
use async_std::sync::Arc;
|
||||
use async_std::task;
|
||||
use ed25519_dalek::PublicKey;
|
||||
|
||||
use crate::keypair::SSBPublicKey;
|
||||
|
@ -31,8 +31,7 @@ pub struct Peer {
|
|||
impl Peer {
|
||||
// TODO: do this properly
|
||||
pub fn to_discovery_packet(&self) -> String {
|
||||
let parts: Vec<String> = self
|
||||
.addresses
|
||||
self.addresses
|
||||
.iter()
|
||||
.map(|address| {
|
||||
let proto = match address.protocol {
|
||||
|
@ -53,8 +52,8 @@ impl Peer {
|
|||
self.key.to_base64(),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
parts.join(";")
|
||||
.collect::<Vec<String>>()
|
||||
.join(";")
|
||||
}
|
||||
|
||||
// TODO: do this properly
|
||||
|
|
Loading…
Reference in New Issue