update all dependencies to latest version. Need to wait for discord-rs to update though

This commit is contained in:
Adrian Malacoda
2018-02-18 16:29:30 -06:00
parent 0b289b6956
commit 3614c7eb5d
14 changed files with 40 additions and 40 deletions

View File

@@ -12,7 +12,7 @@ extern crate regex;
extern crate hlua;
use std::collections::BTreeMap;
use toml::Table;
use toml::value::Table;
mod modules;
use modules::Module;
@@ -177,7 +177,7 @@ struct Subscription {
impl Subscription {
pub fn new (name: String, module: Module) -> Subscription {
let filters: Vec<Box<EventFilter>> = module.config.get("filters")
.and_then(|value| value.as_slice())
.and_then(|value| value.as_array())
.map(|value| value.to_vec())
.unwrap_or(vec![])
.into_iter()

View File

@@ -1,12 +1,11 @@
use std::env;
use std::fs::File;
use std::io::Read;
use std::io::{Read, Write};
extern crate tenquestionmarks;
use tenquestionmarks::Tenquestionmarks;
extern crate toml;
use toml::Parser;
#[macro_use]
extern crate log;
@@ -15,17 +14,17 @@ extern crate env_logger;
extern crate time;
fn init_logger () {
let mut builder = env_logger::LogBuilder::new();
builder.format(|record: &log::LogRecord| {
let mut builder = env_logger::Builder::new();
builder.format(|buf, record: &log::Record| {
let t = time::now();
format!("{} {}:{}: {}", time::strftime("%Y-%m-%d %H:%M:%S", &t).unwrap(), record.level(), record.location().module_path(), record.args())
}).filter(None, log::LogLevelFilter::Info);;
writeln!(buf, "{} {}:{}: {}", time::strftime("%Y-%m-%d %H:%M:%S", &t).unwrap(), record.level(), record.module_path().unwrap_or("?"), record.args())
}).filter(None, log::LevelFilter::Info);;
if env::var("RUST_LOG").is_ok() {
builder.parse(&env::var("RUST_LOG").unwrap());
}
builder.init().unwrap();
builder.init();
}
fn main () {
@@ -37,18 +36,18 @@ fn main () {
if let Err(e) = file.read_to_string(&mut contents) {
error!("Failed to open config file {}: {:?}", config_file_name, e);
} else {
let mut parser = Parser::new(&contents);
if let Some(configuration) = parser.parse() {
info!("Loaded configuration from: {}", config_file_name);
match Tenquestionmarks::from_configuration(configuration) {
Ok(tqm) => {
info!("tenquestionmarks initialized successfully");
tqm.run();
},
Err(e) => error!("Failed to initialize tenquestionmarks: {:?}", e)
}
} else {
error!("Failed to parse config file {}: {:?}. Config file must be a valid TOML file.", config_file_name, parser.errors);
match toml::from_str(&contents) {
Ok(configuration) => {
info!("Loaded configuration from: {}", config_file_name);
match Tenquestionmarks::from_configuration(configuration) {
Ok(tqm) => {
info!("tenquestionmarks initialized successfully");
tqm.run();
},
Err(e) => error!("Failed to initialize tenquestionmarks: {:?}", e)
}
},
Err(error) => error!("Failed to parse config file {}: {:?}. Config file must be a valid TOML file.", config_file_name, error)
}
}
} else {

View File

@@ -1,5 +1,5 @@
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use std::sync::Arc;
use std::sync::mpsc::Receiver;

View File

@@ -4,7 +4,7 @@ use discord::model::{Event, PossibleServer};
use modules::Module;
use modules::EventLoop;
use toml::Table;
use toml::value::Table;
use event;
use event::Envelope;

View File

@@ -1,5 +1,5 @@
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use std::sync::Arc;
use std::sync::mpsc::Receiver;

View File

@@ -1,5 +1,5 @@
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use std::sync::Arc;
use std::sync::mpsc::Receiver;

View File

@@ -2,7 +2,7 @@ use std::collections::BTreeMap;
use std::error::Error;
use std::fmt;
use toml::Table;
use toml::value::Table;
use modules::Module;
use modules::discord::DiscordModule;

View File

@@ -1,5 +1,5 @@
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use std::sync::Arc;
use std::sync::mpsc::Receiver;

View File

@@ -1,6 +1,7 @@
use modules::{Module, EventLoop};
use toml::{Table, Value};
use toml::Value;
use toml::value::Table;
use hlua;
use hlua::{Lua, LuaFunction, Push};

View File

@@ -17,7 +17,7 @@ use std::sync::Arc;
use std::sync::mpsc::Receiver;
use transformable_channels::mpsc::ExtSender;
use toml::Table;
use toml::value::Table;
pub struct Module {
event_loop: Box<EventLoop>,

View File

@@ -1,5 +1,5 @@
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use std::sync::Arc;
use std::sync::mpsc::Receiver;

View File

@@ -1,5 +1,5 @@
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use std::sync::Arc;
use std::sync::mpsc::Receiver;
@@ -21,7 +21,7 @@ impl RandomModule {
.unwrap_or("?random");
let responses = configuration.get("responses")
.and_then(|value| value.as_slice())
.and_then(|value| value.as_array())
.map(|value| value.to_vec())
.unwrap_or(vec![])
.into_iter()

View File

@@ -1,7 +1,7 @@
use std::io;
use modules::{Module, EventLoop};
use toml::Table;
use toml::value::Table;
use {MessageSender, Message, User};