diff options
author | adrien <adrien@luxeylab.net> | 2021-09-11 16:34:03 +0200 |
---|---|---|
committer | adrien <adrien@luxeylab.net> | 2021-09-11 16:34:03 +0200 |
commit | f7200709059c00e74cb25f5d8967d81a834f6bb8 (patch) | |
tree | dab43a23074cbdf41f2ce3740532957f604af779 /src/diplonat.rs | |
parent | fa25c54e47decf9f323ba0c614f4d9de106626d5 (diff) | |
download | diplonat-f7200709059c00e74cb25f5d8967d81a834f6bb8.tar.gz diplonat-f7200709059c00e74cb25f5d8967d81a834f6bb8.zip |
added rustfmt: a rustfmt.toml file diescribing syntax (soft tabs of 2 spaces), a CONTRIBUTING.md file to explain how to use rustfmt, a .drone.yml file to add code style checks in CI, 2 lines in README.md to present CONTRIBUTING.md, and applied rustfmt on the source
Diffstat (limited to 'src/diplonat.rs')
-rw-r--r-- | src/diplonat.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/diplonat.rs b/src/diplonat.rs index 7049530..a17bdc0 100644 --- a/src/diplonat.rs +++ b/src/diplonat.rs @@ -16,25 +16,23 @@ impl Diplonat { pub async fn new() -> Result<Self> { let rt_cfg = ConfigOpts::from_env()?; println!("{:#?}", rt_cfg); - + let ca = ConsulActor::new(&rt_cfg.consul.url, &rt_cfg.consul.node_name); - let fw = FirewallActor::new( - rt_cfg.firewall.refresh_time, - &ca.rx_open_ports - ).await?; - + let fw = FirewallActor::new(rt_cfg.firewall.refresh_time, &ca.rx_open_ports).await?; + let ia = IgdActor::new( - &rt_cfg.igd.private_ip, - rt_cfg.igd.refresh_time, - rt_cfg.igd.expiration_time, - &ca.rx_open_ports - ).await?; + &rt_cfg.igd.private_ip, + rt_cfg.igd.refresh_time, + rt_cfg.igd.expiration_time, + &ca.rx_open_ports, + ) + .await?; let ctx = Self { consul: ca, igd: ia, - firewall: fw + firewall: fw, }; return Ok(ctx); |