aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2019-05-17 19:48:45 +0300
committerHristo Venev <hristo@venev.name>2019-05-17 20:05:32 +0300
commitf726eca619e352e9563697c5db14dd98a97e95de (patch)
treef9fc9b11469651be3d38a1fa12be0b117dafafb3 /src/main.rs
parentef687fa6a504992d639210a50f39d83c77341360 (diff)
rustfmt and style
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index dfadaf4..d56ba39 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,20 +2,22 @@
//
// See COPYING.
+#![deny(rust_2018_idioms)]
+
#[macro_use]
extern crate arrayref;
-use std::{env, fs, io, process, thread};
-use std::time::Instant;
use std::ffi::{OsStr, OsString};
+use std::time::Instant;
+use std::{env, fs, io, process, thread};
use toml;
mod builder;
-mod model;
mod config;
+mod manager;
+mod model;
mod proto;
mod wg;
-mod manager;
fn load_config(path: &OsStr) -> io::Result<config::Config> {
let mut data = String::new();
@@ -30,13 +32,19 @@ fn load_config(path: &OsStr) -> io::Result<config::Config> {
}
fn usage(argv0: &str) -> i32 {
- eprintln!("<1>Invalid arguments. See `{} --help` for more information", argv0);
+ eprintln!(
+ "<1>Invalid arguments. See `{} --help` for more information",
+ argv0
+ );
1
}
fn help(argv0: &str) -> i32 {
println!("Usage:");
- println!(" {} IFNAME CONFIG - run daemon on iterface", argv0);
+ println!(
+ " {} IFNAME CONFIG - run daemon on iterface",
+ argv0
+ );
println!(" {} --check-source PATH - validate source JSON", argv0);
1
}
@@ -113,7 +121,7 @@ fn run_check_source(argv0: String, args: Vec<OsString>) -> i32 {
}
}
-fn main() -> () {
+fn main() {
let mut iter_args = env::args_os();
let argv0 = iter_args.next().unwrap().to_string_lossy().into_owned();