Update reqwest and image

This commit is contained in:
Vincent Prouillet 2018-09-30 19:17:51 +02:00
parent a11f8232de
commit f5c88540ed
7 changed files with 246 additions and 286 deletions

514
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gutenberg" name = "gutenberg"
version = "0.4.2" version = "0.5.0"
authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"] authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"]
license = "MIT" license = "MIT"
readme = "README.md" readme = "README.md"

View file

@ -7,4 +7,4 @@ authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"]
error-chain = "0.12" error-chain = "0.12"
tera = "0.11" tera = "0.11"
toml = "0.4" toml = "0.4"
image = "0.19.0" image = "0.20"

View file

@ -7,7 +7,7 @@ authors = ["Vojtěch Král <vojtech@kral.hk>"]
lazy_static = "1" lazy_static = "1"
regex = "1.0" regex = "1.0"
tera = "0.11" tera = "0.11"
image = "0.19" image = "0.20"
rayon = "1" rayon = "1"
errors = { path = "../errors" } errors = { path = "../errors" }

View file

@ -15,7 +15,7 @@ use std::collections::hash_map::DefaultHasher;
use std::fs::{self, File}; use std::fs::{self, File};
use regex::Regex; use regex::Regex;
use image::{GenericImage, FilterType}; use image::{FilterType, GenericImageView};
use image::jpeg::JPEGEncoder; use image::jpeg::JPEGEncoder;
use rayon::prelude::*; use rayon::prelude::*;

View file

@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"] authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"]
[dependencies] [dependencies]
reqwest = "0.8" reqwest = "0.9"
lazy_static = "1" lazy_static = "1"

View file

@ -2,8 +2,8 @@ extern crate reqwest;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
use reqwest::header::{qitem, Accept, Headers}; use reqwest::header::{HeaderMap, ACCEPT};
use reqwest::{mime, StatusCode}; use reqwest::{StatusCode};
use std::collections::HashMap; use std::collections::HashMap;
use std::error::Error; use std::error::Error;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
@ -54,8 +54,8 @@ pub fn check_url(url: &str) -> LinkResult {
} }
} }
let mut headers = Headers::new(); let mut headers = HeaderMap::new();
headers.set(Accept(vec![qitem(mime::TEXT_HTML), qitem(mime::STAR_STAR)])); headers.insert(ACCEPT, "text/html, *".parse().unwrap());
let client = reqwest::Client::new(); let client = reqwest::Client::new();