From f726eca619e352e9563697c5db14dd98a97e95de Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Fri, 17 May 2019 19:48:45 +0300 Subject: rustfmt and style --- src/main.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/main.rs') 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 { let mut data = String::new(); @@ -30,13 +32,19 @@ fn load_config(path: &OsStr) -> io::Result { } 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) -> i32 { } } -fn main() -> () { +fn main() { let mut iter_args = env::args_os(); let argv0 = iter_args.next().unwrap().to_string_lossy().into_owned(); -- cgit