aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2018-02-12 20:31:56 +0100
committerJokler <jokler.contact@gmail.com>2018-02-12 20:31:56 +0100
commit72f1411f1c72a9271c7d3993a3e307050e8d1b31 (patch)
tree92cbd36b13d09134ad5d8f23bf933c7aba0d7bb4 /src/main.rs
parentd761a8ad9650b4797a673230c2cc924235aafc98 (diff)
downloadfrippy-72f1411f1c72a9271c7d3993a3e307050e8d1b31.tar.gz
frippy-72f1411f1c72a9271c7d3993a3e307050e8d1b31.zip
Run latest rustfmt
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/main.rs b/src/main.rs
index 7df8b3b..9a96791 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,15 +1,15 @@
-#![cfg_attr(feature="clippy", feature(plugin))]
-#![cfg_attr(feature="clippy", plugin(clippy))]
+#![cfg_attr(feature = "clippy", feature(plugin))]
+#![cfg_attr(feature = "clippy", plugin(clippy))]
extern crate frippy;
-extern crate time;
-extern crate irc;
extern crate glob;
+extern crate irc;
+extern crate time;
#[macro_use]
extern crate log;
-use log::{Record, Level, LevelFilter, Metadata};
+use log::{Level, LevelFilter, Metadata, Record};
use irc::client::reactor::IrcReactor;
use glob::glob;
@@ -27,16 +27,20 @@ impl log::Log for Logger {
fn log(&self, record: &Record) {
if self.enabled(record.metadata()) {
if record.metadata().level() >= Level::Debug {
- println!("[{}]({}) {} -> {}",
- time::now().rfc822(),
- record.level(),
- record.target(),
- record.args());
+ println!(
+ "[{}]({}) {} -> {}",
+ time::now().rfc822(),
+ record.level(),
+ record.target(),
+ record.args()
+ );
} else {
- println!("[{}]({}) {}",
- time::now().rfc822(),
- record.level(),
- record.args());
+ println!(
+ "[{}]({}) {}",
+ time::now().rfc822(),
+ record.level(),
+ record.args()
+ );
}
}
}
@@ -47,12 +51,11 @@ impl log::Log for Logger {
static LOGGER: Logger = Logger;
fn main() {
-
log::set_max_level(if cfg!(debug_assertions) {
- LevelFilter::Debug
- } else {
- LevelFilter::Info
- });
+ LevelFilter::Debug
+ } else {
+ LevelFilter::Info
+ });
log::set_logger(&LOGGER).unwrap();
@@ -82,14 +85,10 @@ fn main() {
// Open a connection and add work for each config
for config in configs {
-
let mut disabled_plugins = None;
if let Some(ref options) = config.options {
if let Some(disabled) = options.get("disabled_plugins") {
- disabled_plugins = Some(disabled
- .split(',')
- .map(|p| p.trim())
- .collect::<Vec<_>>());
+ disabled_plugins = Some(disabled.split(',').map(|p| p.trim()).collect::<Vec<_>>());
}
}
@@ -109,7 +108,8 @@ fn main() {
}
}
- bot.connect(&mut reactor, &config).expect("Failed to connect");
+ bot.connect(&mut reactor, &config)
+ .expect("Failed to connect");
}
// Run the bots until they throw an error - an error could be loss of connection