Skip to content

Commit 2c8bdfc

Browse files
authored
Update rocket, diesel and add Amanieu to T-libs (#264)
* Upgrade to Rocket 0.4. * Update diesel to 1.4.1. * rustup nightly * cargo update * Add Amanieu to T-libs.
1 parent 16d64da commit 2c8bdfc

File tree

11 files changed

+948
-427
lines changed

11 files changed

+948
-427
lines changed

Cargo.lock

Lines changed: 920 additions & 397 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ name = "rfcbot-rs"
44
version = "0.1.0"
55

66
[dependencies]
7-
dotenv = "0.9.0"
7+
dotenv = "0.13.0"
88
env_logger = "0.4"
9-
hex = "0.2.0"
10-
handlebars = "0.29.0"
9+
hex = "0.3.2"
1110
hyper = "0.10"
12-
hyper-native-tls = "0.2.1"
13-
lazy_static = "0.2.0"
11+
hyper-native-tls = "0.3.0"
12+
lazy_static = "1.2.0"
1413
log = "0.3.6"
15-
rocket = "0.3.3"
16-
rocket_codegen = "0.3.3"
17-
rocket_contrib = "0.3.3"
14+
rocket = "0.4.0"
15+
rocket_contrib = { version = "0.4.0", features = ["json", "handlebars_templates"] }
1816
rust-crypto = "0.2.36"
1917
serde = "1.0.59"
2018
serde_derive = "1.0.59"
@@ -23,7 +21,7 @@ toml = "0.4"
2321
url = "1.4"
2422
urlencoded = "0.5"
2523
maplit = "1.0.1"
26-
itertools = "0.7.8"
24+
itertools = "0.8.0"
2725

2826
[dependencies.chrono]
2927
features = ["serde"]
@@ -32,4 +30,4 @@ version = "0.4"
3230
[dependencies.diesel]
3331
default-features = false
3432
features = ["postgres", "chrono", "r2d2", "32-column-tables"]
35-
version = "1.3.2"
33+
version = "1.4.1"

rfcbot.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ members = [
5151
"withoutboats",
5252
"Kimundi",
5353
"SimonSapin",
54+
"Amanieu",
5455
]
5556

5657
[teams.T-compiler]

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2018-08-02
1+
nightly-2019-02-22

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use std::convert::From;
55
use std::io;
66

77
use diesel;
8-
use handlebars;
98
use hyper;
109
use serde_json;
10+
use rocket_contrib::templates::handlebars;
1111

1212
pub type DashResult<T> = std::result::Result<T, DashError>;
1313

src/github/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ impl Client {
143143

144144
if tokens[1] == "rel=\"next\"" {
145145
let url = tokens[0]
146-
.trim_left_matches('<')
147-
.trim_right_matches('>')
146+
.trim_start_matches('<')
147+
.trim_end_matches('>')
148148
.to_string();
149149
return Some(url);
150150
}

src/github/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ fn parse_fcp_subcommand<'a>(
216216
fn from_invocation_line<'a>
217217
(setup: &'a RfcbotConfig, command: &'a str) -> DashResult<RfcBotCommand<'a>>
218218
{
219-
let mut tokens = command.trim_left_matches(RFC_BOT_MENTION).trim()
220-
.trim_left_matches(':').trim()
219+
let mut tokens = command.trim_start_matches(RFC_BOT_MENTION).trim()
220+
.trim_start_matches(':').trim()
221221
.split_whitespace();
222222
let invocation = tokens.next().ok_or(DashError::Misc(None))?;
223223
match invocation {

src/github/nag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ fn parse_ticky_boxes<'a>(what: &'a str, id: i32, comment: &'a IssueComment)
187187
-> impl Iterator<Item = &'a str>
188188
{
189189
comment.body.lines().filter_map(move |line| if line.starts_with("* [") {
190-
let l = line.trim_left_matches("* [");
190+
let l = line.trim_start_matches("* [");
191191
let reviewed = l.starts_with('x');
192-
let remaining = l.trim_left_matches("x] @").trim_left_matches(" ] @");
192+
let remaining = l.trim_start_matches("x] @").trim_start_matches(" ] @");
193193

194194
if let Some(username) = remaining.split_whitespace().next() {
195195
trace!("reviewer parsed as reviewed? {} (line: \"{}\")",

src/github/webhooks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crypto::mac::MacResult;
66
use crypto::sha1::Sha1;
77
use hex::FromHex;
88
use rocket::http::Status;
9-
use rocket::data::{self, Data, FromData};
9+
use rocket::data::{self, Data, FromDataSimple};
1010
use rocket::request::Request;
1111
use rocket::outcome::Outcome::*;
1212
use serde_json;
@@ -22,7 +22,7 @@ pub struct Event {
2222
pub payload: Payload,
2323
}
2424

25-
impl FromData for Event {
25+
impl FromDataSimple for Event {
2626
type Error = &'static str;
2727
fn from_data(request: &Request, data: Data) -> data::Outcome<Self, Self::Error> {
2828
let headers = request.headers();

src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#![feature(never_type)]
2-
3-
#![feature(plugin)]
4-
#![feature(never_type)]
5-
#![plugin(rocket_codegen)]
2+
#![feature(proc_macro_hygiene, decl_macro)]
63

74
extern crate chrono;
85
extern crate crypto;
96
#[macro_use]
107
extern crate diesel;
118
extern crate dotenv;
129
extern crate env_logger;
13-
extern crate handlebars;
1410
extern crate hex;
1511
#[macro_use]
1612
extern crate hyper;
@@ -19,6 +15,7 @@ extern crate hyper_native_tls;
1915
extern crate lazy_static;
2016
#[macro_use]
2117
extern crate log;
18+
#[macro_use]
2219
extern crate rocket;
2320
extern crate rocket_contrib;
2421
extern crate serde;

0 commit comments

Comments
 (0)