From 935d61324f295d552258c4a7a790d5cbfd2fb81c Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 30 Mar 2018 21:39:16 +0300 Subject: [PATCH 01/12] ShowWidget: Convert html to pango markup and render it. Instead of stipping all the html tags and just using the text in the label we could *try* converting it to pango markup which is a bit more flexible than plain text. The code was copied from Fractal. --- hammond-gtk/src/main.rs | 2 +- hammond-gtk/src/utils.rs | 83 +++++++++++++++++++++++++++++++++ hammond-gtk/src/widgets/show.rs | 12 +++-- 3 files changed, 91 insertions(+), 6 deletions(-) diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index a648f9b..d5b2b4e 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -20,7 +20,7 @@ extern crate lazy_static; extern crate log; extern crate chrono; -extern crate dissolve; +// extern crate dissolve; extern crate hammond_data; extern crate hammond_downloader; extern crate humansize; diff --git a/hammond-gtk/src/utils.rs b/hammond-gtk/src/utils.rs index 81a9bad..f7c438f 100644 --- a/hammond-gtk/src/utils.rs +++ b/hammond-gtk/src/utils.rs @@ -257,6 +257,49 @@ pub fn time_period_to_duration(time: i64, period: &str) -> Duration { } } +/// https://gitlab.gnome.org/World/fractal/blob/da016b252a0710ffd324469cd2059e3e090695eb/fractal-gtk/src/util.rs#L44-79 +/// Converts the input `&str` to pango format, replacing special characters +/// `&, < and >` and parses URLS to show as a link +/// +/// # Examples +/// +/// ``` +/// let m = markup("this is parsed"); +/// assert_eq!(&m, "this is parsed"); +/// +/// let m = markup("this is parsed"); +/// assert_eq!(&m, "this is <parsed>"); +/// +/// let m = markup(); +/// assert_eq!(&m, "with links: http://gnome.org "); +/// ``` +pub fn html_to_pango_markup(s: &str) -> String { + let mut out = String::from(s); + + out = String::from(out.trim()); + out = out.replace('&', "&"); + out = out.replace('<', "<"); + out = out.replace('>', ">"); + + let amp = "(&)"; + let domain = "[^\\s,)(\"]+"; + let param = format!("({amp}?\\w+(=[\\w._-]+)?)", amp = amp); + let params = format!("(\\?{param}*)*", param = param); + let hash = "(#[\\w._-]+)?"; + + let regex_str = format!( + "(https?://{domain}{params}{hash})", + domain = domain, + params = params, + hash = hash + ); + + let re = Regex::new(®ex_str).unwrap(); + out = String::from(re.replace_all(&out, "$0")); + + out +} + #[cfg(test)] mod tests { use super::*; @@ -327,4 +370,44 @@ mod tests { let id = 000000000; assert!(lookup_id(id).is_err()); } + + #[test] + fn test_markup() { + let markup = html_to_pango_markup; + let m = markup("this is parsed"); + assert_eq!(&m, "this is parsed"); + + let m = markup("this is parsed"); + assert_eq!(&m, "this is <span>parsed</span>"); + + let m = markup("this is &ssdf;"); + assert_eq!(&m, "this is &ssdf;"); + + let url = "http://url.com/test?param1¶m2=test¶m3#hashing"; + let m = markup(&format!("this is &ssdf; {}", url)); + assert_eq!( + &m, + &format!( + "this is &ssdf; {0}", + url.replace('&', "&") + ) + ); + + for l in &[ + ("with links: http://gnome.org :D", "http://gnome.org"), + ( + "with links: http://url.com/test.html&stuff :D", + "http://url.com/test.html&stuff", + ), + ] { + let m = markup(l.0); + assert_eq!( + &m, + &format!( + "with links: {0} :D", + l.1.replace('&', "&") + ) + ); + } + } } diff --git a/hammond-gtk/src/widgets/show.rs b/hammond-gtk/src/widgets/show.rs index ca5ca04..8415ad8 100644 --- a/hammond-gtk/src/widgets/show.rs +++ b/hammond-gtk/src/widgets/show.rs @@ -1,4 +1,4 @@ -use dissolve; +// use dissolve; use failure::Error; // use glib; use gtk; @@ -7,10 +7,11 @@ use open; use hammond_data::Podcast; use hammond_data::dbqueries; -use hammond_data::utils::replace_extra_spaces; +// use hammond_data::utils::replace_extra_spaces; use app::Action; -use utils::set_image_from_path; +use utils::{html_to_pango_markup, set_image_from_path}; +// use utils::set_image_from_path; use widgets::episode::episodes_listbox; use std::sync::Arc; @@ -120,8 +121,9 @@ impl ShowWidget { fn set_description(&self, text: &str) { // TODO: Temporary solution until we render html urls/bold/italic probably with // markup. - let desc = dissolve::strip_html_tags(text).join(" "); - self.description.set_text(&replace_extra_spaces(&desc)); + // let desc = dissolve::strip_html_tags(text).join(" "); + // self.description.set_text(&replace_extra_spaces(&desc)); + self.description.set_text(&html_to_pango_markup(text)); } /// Set scrolled window vertical adjustment. From af1cb43bd62e7c81342330e0e775a91f946bf586 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 30 Mar 2018 22:31:51 +0300 Subject: [PATCH 02/12] NewPodcast: Prefer the rss.description attribute. Since we can handle rendering html stuff by converting it to pango we no longer need the text-only itunes summary attribure. --- hammond-data/src/models/new_podcast.rs | 18 ++++++++++-------- hammond-gtk/resources/gtk/show_widget.ui | 4 +--- hammond-gtk/src/widgets/show.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hammond-data/src/models/new_podcast.rs b/hammond-data/src/models/new_podcast.rs index 97aaaa0..9910599 100644 --- a/hammond-data/src/models/new_podcast.rs +++ b/hammond-data/src/models/new_podcast.rs @@ -1,7 +1,7 @@ use diesel; use diesel::prelude::*; -use ammonia; +// use ammonia; use rss; use errors::DataError; @@ -11,7 +11,8 @@ use schema::podcast; use database::connection; use dbqueries; -use utils::{replace_extra_spaces, url_cleaner}; +// use utils::{replace_extra_spaces, url_cleaner}; +use utils::url_cleaner; #[derive(Insertable, AsChangeset)] #[table_name = "podcast"] @@ -90,14 +91,15 @@ impl NewPodcast { pub(crate) fn new(chan: &rss::Channel, source_id: i32) -> NewPodcast { let title = chan.title().trim(); + let description = chan.description().trim(); // Prefer itunes summary over rss.description since many feeds put html into // rss.description. - let summary = chan.itunes_ext().map(|s| s.summary()).and_then(|s| s); - let description = if let Some(sum) = summary { - replace_extra_spaces(&ammonia::clean(sum)) - } else { - replace_extra_spaces(&ammonia::clean(chan.description())) - }; + // let summary = chan.itunes_ext().map(|s| s.summary()).and_then(|s| s); + // let description = if let Some(sum) = summary { + // replace_extra_spaces(&ammonia::clean(sum)) + // } else { + // replace_extra_spaces(&ammonia::clean(chan.description())) + // }; let link = url_cleaner(chan.link()); let itunes_img = chan.itunes_ext() diff --git a/hammond-gtk/resources/gtk/show_widget.ui b/hammond-gtk/resources/gtk/show_widget.ui index 4f41060..c48911c 100644 --- a/hammond-gtk/resources/gtk/show_widget.ui +++ b/hammond-gtk/resources/gtk/show_widget.ui @@ -112,12 +112,10 @@ Tobias Bernard start end foo + True True word-char 90 - - - False diff --git a/hammond-gtk/src/widgets/show.rs b/hammond-gtk/src/widgets/show.rs index 8415ad8..7917d7b 100644 --- a/hammond-gtk/src/widgets/show.rs +++ b/hammond-gtk/src/widgets/show.rs @@ -123,7 +123,7 @@ impl ShowWidget { // markup. // let desc = dissolve::strip_html_tags(text).join(" "); // self.description.set_text(&replace_extra_spaces(&desc)); - self.description.set_text(&html_to_pango_markup(text)); + self.description.set_markup(&html_to_pango_markup(text)); } /// Set scrolled window vertical adjustment. From a946ddfab116a9736382421257ff8066bc7306cf Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 2 Apr 2018 22:55:20 +0300 Subject: [PATCH 03/12] html_to_pango: Switch to use the new library spawn from this. Thanks to @danigm for spinning that part of fractal to a shared library. --- Cargo.lock | 12 +++++++++ hammond-gtk/Cargo.toml | 2 ++ hammond-gtk/src/main.rs | 2 ++ hammond-gtk/src/utils.rs | 43 --------------------------------- hammond-gtk/src/widgets/show.rs | 7 ++++-- 5 files changed, 21 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01181d1..a615610 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -698,6 +698,7 @@ dependencies = [ name = "hammond-gtk" version = "0.1.0" dependencies = [ + "ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "dissolve 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -709,6 +710,7 @@ dependencies = [ "gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hammond-data 0.1.0", "hammond-downloader 0.1.0", + "html2pango 0.1.0 (git+https://gitlab.gnome.org/danigm/html2pango)", "humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -738,6 +740,15 @@ dependencies = [ "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "html2pango" +version = "0.1.0" +source = "git+https://gitlab.gnome.org/danigm/html2pango#5bf56226d889c6174473784d0fe437cab288b0d4" +dependencies = [ + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "html5ever" version = "0.21.0" @@ -2106,6 +2117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "414f3522f550a0b4f65e089f00ffcd3987dab8b0be284cb979aa7f6a03d60516" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum handlebars 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7bdb08e879b8c78ee90f5022d121897c31ea022cb0cc6d13f2158c7a9fbabb1" +"checksum html2pango 0.1.0 (git+https://gitlab.gnome.org/danigm/html2pango)" = "" "checksum html5ever 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba3a1fd1857a714d410c191364c5d7bf8a6487c0ab5575146d37dd7eb17ef523" "checksum html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e579ac8647178ab915d400d7d22938bda5cd351c6c62e1c294d56884ccfc75fe" "checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37" diff --git a/hammond-gtk/Cargo.toml b/hammond-gtk/Cargo.toml index 97f59e8..d5c9d94 100644 --- a/hammond-gtk/Cargo.toml +++ b/hammond-gtk/Cargo.toml @@ -6,6 +6,7 @@ version = "0.1.0" workspace = "../" [dependencies] +ammonia = "1.1.0" chrono = "0.4.1" dissolve = "0.2.2" gdk = "0.8.0" @@ -25,6 +26,7 @@ take_mut = "0.2.2" regex = "0.2.10" reqwest = "0.8.5" serde_json = "1.0.13" +html2pango = { git = "https://gitlab.gnome.org/danigm/html2pango" } [dependencies.gtk] features = ["v3_22"] diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index d5b2b4e..10d3af4 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -19,10 +19,12 @@ extern crate lazy_static; #[macro_use] extern crate log; +extern crate ammonia; extern crate chrono; // extern crate dissolve; extern crate hammond_data; extern crate hammond_downloader; +extern crate html2pango; extern crate humansize; extern crate loggerv; extern crate open; diff --git a/hammond-gtk/src/utils.rs b/hammond-gtk/src/utils.rs index f7c438f..c398b4c 100644 --- a/hammond-gtk/src/utils.rs +++ b/hammond-gtk/src/utils.rs @@ -257,49 +257,6 @@ pub fn time_period_to_duration(time: i64, period: &str) -> Duration { } } -/// https://gitlab.gnome.org/World/fractal/blob/da016b252a0710ffd324469cd2059e3e090695eb/fractal-gtk/src/util.rs#L44-79 -/// Converts the input `&str` to pango format, replacing special characters -/// `&, < and >` and parses URLS to show as a link -/// -/// # Examples -/// -/// ``` -/// let m = markup("this is parsed"); -/// assert_eq!(&m, "this is parsed"); -/// -/// let m = markup("this is parsed"); -/// assert_eq!(&m, "this is <parsed>"); -/// -/// let m = markup(); -/// assert_eq!(&m, "with links: http://gnome.org "); -/// ``` -pub fn html_to_pango_markup(s: &str) -> String { - let mut out = String::from(s); - - out = String::from(out.trim()); - out = out.replace('&', "&"); - out = out.replace('<', "<"); - out = out.replace('>', ">"); - - let amp = "(&)"; - let domain = "[^\\s,)(\"]+"; - let param = format!("({amp}?\\w+(=[\\w._-]+)?)", amp = amp); - let params = format!("(\\?{param}*)*", param = param); - let hash = "(#[\\w._-]+)?"; - - let regex_str = format!( - "(https?://{domain}{params}{hash})", - domain = domain, - params = params, - hash = hash - ); - - let re = Regex::new(®ex_str).unwrap(); - out = String::from(re.replace_all(&out, "$0")); - - out -} - #[cfg(test)] mod tests { use super::*; diff --git a/hammond-gtk/src/widgets/show.rs b/hammond-gtk/src/widgets/show.rs index 7917d7b..36236ca 100644 --- a/hammond-gtk/src/widgets/show.rs +++ b/hammond-gtk/src/widgets/show.rs @@ -1,8 +1,10 @@ // use dissolve; use failure::Error; // use glib; +use ammonia; use gtk; use gtk::prelude::*; +use html2pango::markup as html_to_pango_markup; use open; use hammond_data::Podcast; @@ -10,7 +12,7 @@ use hammond_data::dbqueries; // use hammond_data::utils::replace_extra_spaces; use app::Action; -use utils::{html_to_pango_markup, set_image_from_path}; +use utils::set_image_from_path; // use utils::set_image_from_path; use widgets::episode::episodes_listbox; @@ -123,7 +125,8 @@ impl ShowWidget { // markup. // let desc = dissolve::strip_html_tags(text).join(" "); // self.description.set_text(&replace_extra_spaces(&desc)); - self.description.set_markup(&html_to_pango_markup(text)); + self.description + .set_markup(&ammonia::clean(&html_to_pango_markup(text))); } /// Set scrolled window vertical adjustment. From a463753c84d0d868b6c0b4b7069277d3ec7e1328 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 2 Apr 2018 23:49:03 +0300 Subject: [PATCH 04/12] NewEpidode: Use parse rss.description instead of itunes.summary. We can deal with(sort of) html now, so we should start indexing the proper rss description. Also cleanup commented out code. --- hammond-data/src/lib.rs | 1 - hammond-data/src/models/new_episode.rs | 27 ++++++----------- hammond-data/src/models/new_podcast.rs | 22 ++++---------- hammond-gtk/src/utils.rs | 40 -------------------------- 4 files changed, 15 insertions(+), 75 deletions(-) diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 52e58d3..095564d 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -35,7 +35,6 @@ extern crate lazy_static; #[macro_use] extern crate log; -extern crate ammonia; extern crate chrono; extern crate futures; extern crate futures_cpupool; diff --git a/hammond-data/src/models/new_episode.rs b/hammond-data/src/models/new_episode.rs index ad1a12d..a86c65b 100644 --- a/hammond-data/src/models/new_episode.rs +++ b/hammond-data/src/models/new_episode.rs @@ -1,4 +1,3 @@ -use ammonia; use diesel; use diesel::prelude::*; use rfc822_sanitizer::parse_from_rfc2822_with_fallback as parse_rfc822; @@ -10,7 +9,7 @@ use errors::DataError; use models::{Episode, EpisodeMinimal, Index, Insert, Update}; use parser; use schema::episode; -use utils::{replace_extra_spaces, url_cleaner}; +use utils::url_cleaner; #[derive(Insertable, AsChangeset)] #[table_name = "episode"] @@ -231,15 +230,7 @@ impl NewEpisodeMinimal { pub(crate) fn into_new_episode(self, item: &rss::Item) -> NewEpisode { let length = || -> Option { item.enclosure().map(|x| x.length().parse().ok())? }(); - // Prefer itunes summary over rss.description since many feeds put html into - // rss.description. - let summary = item.itunes_ext().map(|s| s.summary()).and_then(|s| s); - let description = if summary.is_some() { - summary.map(|s| replace_extra_spaces(&ammonia::clean(s))) - } else { - item.description() - .map(|s| replace_extra_spaces(&ammonia::clean(s))) - }; + let description = item.description().map(|s| s.to_owned()); NewEpisodeBuilder::default() .title(self.title) @@ -413,7 +404,7 @@ mod tests { static ref EXPECTED_LUP_1: NewEpisode = { let descr = "Audit your network with a couple of easy commands on Kali Linux. Chris \ decides to blow off a little steam by attacking his IoT devices, Wes has \ - the scope on Equifax blaming open source & the Beard just saved the \ + the scope on Equifax blaming open source & the Beard just saved the \ show. It’s a really packed episode!"; NewEpisodeBuilder::default() @@ -431,12 +422,12 @@ mod tests { .unwrap() }; static ref EXPECTED_LUP_2: NewEpisode = { - let descr = "The Gnome project is about to solve one of our audience's biggest \ - Wayland’s concerns. But as the project takes on a new level of \ - relevance, decisions for the next version of Gnome have us worried about \ - the future.\nPlus we chat with Wimpy about the Ubuntu Rally in NYC, \ - Microsoft’s sneaky move to turn Windows 10 into the “ULTIMATE LINUX \ - RUNTIME”, community news & more!"; + let descr = + "

The Gnome project is about to solve one of our audience's biggest Wayland’s \ + concerns. But as the project takes on a new level of relevance, decisions for \ + the next version of Gnome have us worried about the future.

\n\n

Plus we \ + chat with Wimpy about the Ubuntu Rally in NYC, Microsoft’s sneaky move to turn \ + Windows 10 into the “ULTIMATE LINUX RUNTIME”, community news & more!

"; NewEpisodeBuilder::default() .title("Gnome Does it Again | LUP 213") diff --git a/hammond-data/src/models/new_podcast.rs b/hammond-data/src/models/new_podcast.rs index 9910599..d3450ec 100644 --- a/hammond-data/src/models/new_podcast.rs +++ b/hammond-data/src/models/new_podcast.rs @@ -11,7 +11,6 @@ use schema::podcast; use database::connection; use dbqueries; -// use utils::{replace_extra_spaces, url_cleaner}; use utils::url_cleaner; #[derive(Insertable, AsChangeset)] @@ -92,15 +91,6 @@ impl NewPodcast { let title = chan.title().trim(); let description = chan.description().trim(); - // Prefer itunes summary over rss.description since many feeds put html into - // rss.description. - // let summary = chan.itunes_ext().map(|s| s.summary()).and_then(|s| s); - // let description = if let Some(sum) = summary { - // replace_extra_spaces(&ammonia::clean(sum)) - // } else { - // replace_extra_spaces(&ammonia::clean(chan.description())) - // }; - let link = url_cleaner(chan.link()); let itunes_img = chan.itunes_ext() .and_then(|s| s.image()) @@ -171,7 +161,7 @@ mod tests { let descr = "The people behind The Intercept’s fearless reporting and incisive \ commentary—Jeremy Scahill, Glenn Greenwald, Betsy Reed and \ others—discuss the crucial issues of our time: national security, civil \ - liberties, foreign policy, and criminal justice. Plus interviews with \ + liberties, foreign policy, and criminal justice. Plus interviews with \ artists, thinkers, and newsmakers who challenge our preconceptions about \ the world we live in."; @@ -205,15 +195,15 @@ mod tests { .unwrap() }; static ref EXPECTED_TIPOFF: NewPodcast = { - let desc = "Welcome to The Tip Off- the podcast where we take you behind the scenes \ - of some of the best investigative journalism from recent years. Each \ - episode we’ll be digging into an investigative scoop- hearing from the \ - journalists behind the work as they tell us about the leads, the \ + let desc = "

Welcome to The Tip Off- the podcast where we take you behind the \ + scenes of some of the best investigative journalism from recent years. \ + Each episode we’ll be digging into an investigative scoop- hearing from \ + the journalists behind the work as they tell us about the leads, the \ dead-ends and of course, the tip offs. There’ll be car chases, slammed \ doors, terrorist cells, meetings in dimly lit bars and cafes, wrangling \ with despotic regimes and much more. So if you’re curious about the fun, \ complicated detective work that goes into doing great investigative \ - journalism- then this is the podcast for you."; + journalism- then this is the podcast for you.

"; NewPodcastBuilder::default() .title("The Tip Off") diff --git a/hammond-gtk/src/utils.rs b/hammond-gtk/src/utils.rs index c398b4c..81a9bad 100644 --- a/hammond-gtk/src/utils.rs +++ b/hammond-gtk/src/utils.rs @@ -327,44 +327,4 @@ mod tests { let id = 000000000; assert!(lookup_id(id).is_err()); } - - #[test] - fn test_markup() { - let markup = html_to_pango_markup; - let m = markup("this is parsed"); - assert_eq!(&m, "this is parsed"); - - let m = markup("this is parsed"); - assert_eq!(&m, "this is <span>parsed</span>"); - - let m = markup("this is &ssdf;"); - assert_eq!(&m, "this is &ssdf;"); - - let url = "http://url.com/test?param1¶m2=test¶m3#hashing"; - let m = markup(&format!("this is &ssdf; {}", url)); - assert_eq!( - &m, - &format!( - "this is &ssdf; {0}", - url.replace('&', "&") - ) - ); - - for l in &[ - ("with links: http://gnome.org :D", "http://gnome.org"), - ( - "with links: http://url.com/test.html&stuff :D", - "http://url.com/test.html&stuff", - ), - ] { - let m = markup(l.0); - assert_eq!( - &m, - &format!( - "with links: {0} :D", - l.1.replace('&', "&") - ) - ); - } - } } From e07e35110d45f0be70e0800923a686e0d8397943 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 2 Apr 2018 23:54:27 +0300 Subject: [PATCH 05/12] Use pretty assertions! --- Cargo.lock | 19 +++++++++++++++++++ hammond-data/Cargo.toml | 1 + hammond-data/src/lib.rs | 4 ++++ hammond-downloader/Cargo.toml | 2 ++ hammond-downloader/src/lib.rs | 4 ++++ hammond-gtk/Cargo.toml | 3 +++ hammond-gtk/src/main.rs | 4 ++++ 7 files changed, 37 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index a615610..b514895 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -377,6 +377,11 @@ dependencies = [ "migrations_macros 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "dissolve" version = "0.2.2" @@ -668,6 +673,7 @@ dependencies = [ "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rfc822_sanitizer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -690,6 +696,7 @@ dependencies = [ "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 1.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -716,6 +723,7 @@ dependencies = [ "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "loggerv 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "open 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1262,6 +1270,15 @@ name = "precomputed-hash" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "pretty_assertions" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "proc-macro2" version = "0.2.3" @@ -2090,6 +2107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum diesel 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925325c57038f2f14c0413bdf6a92ca72acff644959d0a1a9ebf8d19be7e9c01" "checksum diesel_derives 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28e2b2605ac6a3b9a586383f5f8b2b5f1108f07a421ade965b266289d2805e79" "checksum diesel_migrations 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0928a7d6f27c849954185416bd59439837de55fbc89e2985b0e46e756ae4e3da" +"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" "checksum dissolve 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "898542be4716d992082c8e4fc331b792d626cfa71cb2b4790f828b9a8f921a90" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" @@ -2177,6 +2195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +"checksum pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a029430f0d744bc3d15dd474d591bed2402b645d024583082b9f63bb936dac6" "checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" "checksum quick-xml 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b14c27e04216596a49f2b82398a24f67ed9f131a5c0e0235496ea446bdacfb12" diff --git a/hammond-data/Cargo.toml b/hammond-data/Cargo.toml index 6e7d655..73b91ec 100644 --- a/hammond-data/Cargo.toml +++ b/hammond-data/Cargo.toml @@ -38,6 +38,7 @@ version = "1.1.0" rand = "0.4.2" tempdir = "0.3.7" criterion = "0.2.2" +pretty_assertions = "0.5.1" [[bench]] name = "bench" diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 095564d..d49d047 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -20,6 +20,10 @@ //! FIXME: Docs +#[cfg(test)] +#[macro_use] +extern crate pretty_assertions; + #[macro_use] extern crate derive_builder; #[macro_use] diff --git a/hammond-downloader/Cargo.toml b/hammond-downloader/Cargo.toml index b02e723..d1cb267 100644 --- a/hammond-downloader/Cargo.toml +++ b/hammond-downloader/Cargo.toml @@ -18,3 +18,5 @@ failure_derive = "0.1.1" [dependencies.hammond-data] path = "../hammond-data" +[dev-dependencies] +pretty_assertions = "0.5.1" \ No newline at end of file diff --git a/hammond-downloader/src/lib.rs b/hammond-downloader/src/lib.rs index 37b2c40..e48d8a6 100644 --- a/hammond-downloader/src/lib.rs +++ b/hammond-downloader/src/lib.rs @@ -9,6 +9,10 @@ extern crate failure_derive; #[macro_use] extern crate log; +#[cfg(test)] +#[macro_use] +extern crate pretty_assertions; + extern crate glob; extern crate hammond_data; extern crate hyper; diff --git a/hammond-gtk/Cargo.toml b/hammond-gtk/Cargo.toml index d5c9d94..7c9d0a8 100644 --- a/hammond-gtk/Cargo.toml +++ b/hammond-gtk/Cargo.toml @@ -41,3 +41,6 @@ path = "../hammond-data" [dependencies.hammond-downloader] path = "../hammond-downloader" + +[dev-dependencies] +pretty_assertions = "0.5.1" \ No newline at end of file diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 10d3af4..eac14c7 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -19,6 +19,10 @@ extern crate lazy_static; #[macro_use] extern crate log; +#[cfg(test)] +#[macro_use] +extern crate pretty_assertions; + extern crate ammonia; extern crate chrono; // extern crate dissolve; From 7a3a148359973331f7a435735fbe3d2e90aab472 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 11:35:40 +0300 Subject: [PATCH 06/12] Remove more dead code. --- hammond-data/src/utils.rs | 34 --------------------------------- hammond-gtk/src/widgets/show.rs | 7 ------- 2 files changed, 41 deletions(-) diff --git a/hammond-data/src/utils.rs b/hammond-data/src/utils.rs index d17ee09..80cc5ae 100644 --- a/hammond-data/src/utils.rs +++ b/hammond-data/src/utils.rs @@ -110,22 +110,6 @@ pub fn url_cleaner(s: &str) -> String { } } -/// Helper functions that strips extra spaces and newlines and ignores the tabs. -#[allow(match_same_arms)] -pub fn replace_extra_spaces(s: &str) -> String { - s.trim() - .chars() - .filter(|ch| *ch != '\t') - .coalesce(|current, next| match (current, next) { - ('\n', '\n') => Ok('\n'), - ('\n', ' ') => Ok('\n'), - (' ', '\n') => Ok('\n'), - (' ', ' ') => Ok(' '), - (_, _) => Err((current, next)), - }) - .collect::() -} - /// Returns the URI of a Podcast Downloads given it's title. pub fn get_download_folder(pd_title: &str) -> Result { // It might be better to make it a hash of the title or the podcast rowid @@ -296,24 +280,6 @@ mod tests { assert_eq!(url_cleaner(&format!(" {}\t\n", bad_url)), good_url); } - #[test] - fn test_whitespace() { - let bad_txt = "1 2 3 4 5"; - let valid_txt = "1 2 3 4 5"; - - assert_eq!(replace_extra_spaces(&bad_txt), valid_txt); - - let bad_txt = "1 2 3 \n 4 5\n"; - let valid_txt = "1 2 3\n4 5"; - - assert_eq!(replace_extra_spaces(&bad_txt), valid_txt); - - let bad_txt = "1 2 3 \n\n\n \n 4 5\n"; - let valid_txt = "1 2 3\n4 5"; - - assert_eq!(replace_extra_spaces(&bad_txt), valid_txt); - } - #[test] // This test needs access to local system so we ignore it by default. #[ignore] diff --git a/hammond-gtk/src/widgets/show.rs b/hammond-gtk/src/widgets/show.rs index 36236ca..6c38c95 100644 --- a/hammond-gtk/src/widgets/show.rs +++ b/hammond-gtk/src/widgets/show.rs @@ -1,4 +1,3 @@ -// use dissolve; use failure::Error; // use glib; use ammonia; @@ -9,11 +8,9 @@ use open; use hammond_data::Podcast; use hammond_data::dbqueries; -// use hammond_data::utils::replace_extra_spaces; use app::Action; use utils::set_image_from_path; -// use utils::set_image_from_path; use widgets::episode::episodes_listbox; use std::sync::Arc; @@ -121,10 +118,6 @@ impl ShowWidget { /// Set the descripton text. fn set_description(&self, text: &str) { - // TODO: Temporary solution until we render html urls/bold/italic probably with - // markup. - // let desc = dissolve::strip_html_tags(text).join(" "); - // self.description.set_text(&replace_extra_spaces(&desc)); self.description .set_markup(&ammonia::clean(&html_to_pango_markup(text))); } From 4ed70a8011c53b81d01c6aec8b87bb1cd5997b09 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 11:57:38 +0300 Subject: [PATCH 07/12] Rss::Error is now Send! --- hammond-data/src/errors.rs | 16 ++++++++-------- hammond-data/src/models/source.rs | 5 ++--- hammond-data/src/utils.rs | 1 - 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hammond-data/src/errors.rs b/hammond-data/src/errors.rs index ccddd85..300c561 100644 --- a/hammond-data/src/errors.rs +++ b/hammond-data/src/errors.rs @@ -3,17 +3,12 @@ use diesel::r2d2; use diesel_migrations::RunMigrationsError; use hyper; use native_tls; -// use rss; +use rss; use url; use std::io; // use std::fmt; -// fadsadfs NOT SYNC -// #[derive(Fail, Debug)] -// #[fail(display = "RSS Error: {}", _0)] -// struct RSSError(rss::Error); - #[derive(Fail, Debug)] pub enum DataError { #[fail(display = "SQL Query failed: {}", _0)] @@ -34,8 +29,7 @@ pub enum DataError { #[fail(display = "IO Error: {}", _0)] IOError(#[cause] io::Error), #[fail(display = "RSS Error: {}", _0)] - // Rss::Error is not yet Sync - RssCrateError(String), + RssError(#[cause] rss::Error), #[fail(display = "Error: {}", _0)] Bail(String), #[fail(display = "Request to {} returned {}. Context: {}", url, status_code, context)] @@ -100,6 +94,12 @@ impl From for DataError { } } +impl From for DataError { + fn from(err: rss::Error) -> Self { + DataError::RssError(err) + } +} + impl From for DataError { fn from(err: String) -> Self { DataError::Bail(err) diff --git a/hammond-data/src/models/source.rs b/hammond-data/src/models/source.rs index 74c155f..1921e28 100644 --- a/hammond-data/src/models/source.rs +++ b/hammond-data/src/models/source.rs @@ -293,9 +293,8 @@ fn response_to_channel( .map_err(From::from) .map(|iter| iter.collect::>()) .map(|utf_8_bytes| String::from_utf8_lossy(&utf_8_bytes).into_owned()) - .and_then(|buf| { - Channel::from_str(&buf).or_else(|err| Err(DataError::RssCrateError(format!("{}", err)))) - }); + .and_then(|buf| Channel::from_str(&buf).map_err(From::from)); + let cpu_chan = pool.spawn(chan); Box::new(cpu_chan) } diff --git a/hammond-data/src/utils.rs b/hammond-data/src/utils.rs index 80cc5ae..4cc3bd4 100644 --- a/hammond-data/src/utils.rs +++ b/hammond-data/src/utils.rs @@ -3,7 +3,6 @@ use chrono::prelude::*; use rayon::prelude::*; -use itertools::Itertools; use url::{Position, Url}; use dbqueries; From 2d7ba7b246f0f8c3d783a54e687a441e5f1159ee Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 12:22:25 +0300 Subject: [PATCH 08/12] h-data/source.rs: Reduce boilerplate. --- hammond-data/src/models/source.rs | 78 +++++++------------------------ 1 file changed, 16 insertions(+), 62 deletions(-) diff --git a/hammond-data/src/models/source.rs b/hammond-data/src/models/source.rs index 1921e28..fe6e87c 100644 --- a/hammond-data/src/models/source.rs +++ b/hammond-data/src/models/source.rs @@ -102,6 +102,14 @@ impl Source { Ok(()) } + fn make_err(self, context: &str, code: StatusCode) -> DataError { + DataError::HttpStatusError { + url: self.uri, + status_code: code, + context: context.into(), + } + } + // TODO match on more stuff // 301: Moved Permanently // 304: Up to date Feed, checked with the Etag @@ -115,75 +123,21 @@ impl Source { fn match_status(mut self, res: Response) -> Result<(Self, Response), DataError> { self.update_etag(&res)?; let code = res.status(); - match code { - StatusCode::NotModified => { - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "304: skipping..".into(), - }; - return Err(err); - } + match code { + StatusCode::NotModified => return Err(self.make_err("304: skipping..", code)), StatusCode::MovedPermanently => { error!("Feed was moved permanently."); self.handle_301(&res)?; - - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "301: Feed was moved permanently.".into(), - }; - - return Err(err); + return Err(self.make_err("301: Feed was moved permanently.", code)); } StatusCode::TemporaryRedirect => debug!("307: Temporary Redirect."), StatusCode::PermanentRedirect => warn!("308: Permanent Redirect."), - StatusCode::Unauthorized => { - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "401: Unauthorized.".into(), - }; - - return Err(err); - } - StatusCode::Forbidden => { - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "403: Forbidden.".into(), - }; - - return Err(err); - } - StatusCode::NotFound => { - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "404: Not found.".into(), - }; - - return Err(err); - } - StatusCode::RequestTimeout => { - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "408: Request Timeout.".into(), - }; - - return Err(err); - } - StatusCode::Gone => { - let err = DataError::HttpStatusError { - url: self.uri, - status_code: code, - context: "410: Feed was deleted..".into(), - }; - - return Err(err); - } + StatusCode::Unauthorized => return Err(self.make_err("401: Unauthorized.", code)), + StatusCode::Forbidden => return Err(self.make_err("403: Forbidden.", code)), + StatusCode::NotFound => return Err(self.make_err("404: Not found.", code)), + StatusCode::RequestTimeout => return Err(self.make_err("408: Request Timeout.", code)), + StatusCode::Gone => return Err(self.make_err("410: Feed was deleted..", code)), _ => info!("HTTP StatusCode: {}", code), }; Ok((self, res)) From 1c527cba03a6146d7c5d835f6503246130198b46 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 13:04:05 +0300 Subject: [PATCH 09/12] Remove more commented out dead code. --- Cargo.lock | 59 -------------------------- hammond-data/src/errors.rs | 1 - hammond-data/src/models/new_podcast.rs | 2 - hammond-gtk/Cargo.toml | 1 - hammond-gtk/src/main.rs | 1 - 5 files changed, 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b514895..0f1e949 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -382,15 +382,6 @@ name = "difference" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "dissolve" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "html5ever 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "dtoa" version = "0.4.2" @@ -707,7 +698,6 @@ version = "0.1.0" dependencies = [ "ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "dissolve 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -757,18 +747,6 @@ dependencies = [ "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "html5ever" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "markup5ever 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "html5ever" version = "0.22.0" @@ -963,19 +941,6 @@ name = "maplit" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "markup5ever" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "markup5ever" version = "0.7.2" @@ -1464,11 +1429,6 @@ name = "rustc-demangle" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "safemem" version = "0.2.0" @@ -1603,20 +1563,6 @@ name = "smallvec" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "string_cache" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "string_cache" version = "0.7.1" @@ -2108,7 +2054,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum diesel_derives 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28e2b2605ac6a3b9a586383f5f8b2b5f1108f07a421ade965b266289d2805e79" "checksum diesel_migrations 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0928a7d6f27c849954185416bd59439837de55fbc89e2985b0e46e756ae4e3da" "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" -"checksum dissolve 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "898542be4716d992082c8e4fc331b792d626cfa71cb2b4790f828b9a8f921a90" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum encoding_rs 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98fd0f24d1fb71a4a6b9330c8ca04cbd4e7cc5d846b54ca74ff376bc7c9f798d" @@ -2136,7 +2081,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum handlebars 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7bdb08e879b8c78ee90f5022d121897c31ea022cb0cc6d13f2158c7a9fbabb1" "checksum html2pango 0.1.0 (git+https://gitlab.gnome.org/danigm/html2pango)" = "" -"checksum html5ever 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba3a1fd1857a714d410c191364c5d7bf8a6487c0ab5575146d37dd7eb17ef523" "checksum html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e579ac8647178ab915d400d7d22938bda5cd351c6c62e1c294d56884ccfc75fe" "checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37" "checksum humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e" @@ -2161,7 +2105,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum loggerv 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ba6b0664956d197c6e0223870c1cd1ec4117aea282b4c0bd5ab01119d31d708d" "checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" -"checksum markup5ever 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2cf89d3e0486c32c9d99521455ddf9a438910a1ce2bd376936086edc15dff5fc" "checksum markup5ever 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfedc97d5a503e96816d10fedcd5b42f760b2e525ce2f7ec71f6a41780548475" "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" @@ -2216,7 +2159,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rfc822_sanitizer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "680e8305c1e0cdf836dc4bec5424e045f278c975a3cac36d1ca01c4695f9d815" "checksum rss 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfaaee0d75c76ae197cc2671dc8c531314006e48790c725a9bf0b227d91d19e8" "checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb" -"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" "checksum schannel 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "fbaffce35eb61c5b00846e73128b0cd62717e7c0ec46abbec132370d013975b4" "checksum scheduled-thread-pool 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a2ff3fc5223829be817806c6441279c676e454cc7da608faf03b0ccc09d3889" @@ -2235,7 +2177,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" -"checksum string_cache 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "413fc7852aeeb5472f1986ef755f561ddf0c789d3d796e65f0b6fe293ecd4ef8" "checksum string_cache 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39cb4173bcbd1319da31faa5468a7e3870683d7a237150b0b0aaafd546f6ad12" "checksum string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "479cde50c3539481f33906a387f2bd17c8e87cb848c35b6021d41fb81ff9b4d7" "checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc" diff --git a/hammond-data/src/errors.rs b/hammond-data/src/errors.rs index 300c561..1b87ca0 100644 --- a/hammond-data/src/errors.rs +++ b/hammond-data/src/errors.rs @@ -7,7 +7,6 @@ use rss; use url; use std::io; -// use std::fmt; #[derive(Fail, Debug)] pub enum DataError { diff --git a/hammond-data/src/models/new_podcast.rs b/hammond-data/src/models/new_podcast.rs index d3450ec..db77cbc 100644 --- a/hammond-data/src/models/new_podcast.rs +++ b/hammond-data/src/models/new_podcast.rs @@ -1,7 +1,5 @@ use diesel; use diesel::prelude::*; - -// use ammonia; use rss; use errors::DataError; diff --git a/hammond-gtk/Cargo.toml b/hammond-gtk/Cargo.toml index 7c9d0a8..75d1704 100644 --- a/hammond-gtk/Cargo.toml +++ b/hammond-gtk/Cargo.toml @@ -8,7 +8,6 @@ workspace = "../" [dependencies] ammonia = "1.1.0" chrono = "0.4.1" -dissolve = "0.2.2" gdk = "0.8.0" gdk-pixbuf = "0.4.0" glib = "0.5.0" diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index eac14c7..7fa4bda 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -25,7 +25,6 @@ extern crate pretty_assertions; extern crate ammonia; extern crate chrono; -// extern crate dissolve; extern crate hammond_data; extern crate hammond_downloader; extern crate html2pango; From 7ba834ee8ddcc275595996632978466cbc35cfde Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 13:11:36 +0300 Subject: [PATCH 10/12] Update deps now that we are at it. --- Cargo.lock | 159 ++++++++++++++++++---------------- hammond-data/Cargo.toml | 2 +- hammond-downloader/Cargo.toml | 2 +- hammond-gtk/Cargo.toml | 2 +- 4 files changed, 88 insertions(+), 77 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f1e949..df6c73f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,7 +93,7 @@ name = "base64" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -114,7 +114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -122,7 +122,7 @@ name = "bytes" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -232,8 +232,8 @@ dependencies = [ "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "itertools-num 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "simplelog 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -243,7 +243,7 @@ name = "criterion-plot" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -353,7 +353,7 @@ name = "diesel" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_derives 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsqlite3-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -465,7 +465,7 @@ dependencies = [ [[package]] name = "futures" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -473,7 +473,7 @@ name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -655,7 +655,7 @@ dependencies = [ "diesel_migrations 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -731,17 +731,17 @@ dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "html2pango" version = "0.1.0" -source = "git+https://gitlab.gnome.org/danigm/html2pango#5bf56226d889c6174473784d0fe437cab288b0d4" +source = "git+https://gitlab.gnome.org/danigm/html2pango#2e55f7587a2e7d75cf3ceed814fd473d60384dd2" dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -776,7 +776,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -798,7 +798,7 @@ name = "hyper-tls" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -892,7 +892,7 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -948,8 +948,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1182,7 +1182,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pest_derive" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1246,7 +1246,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "0.2.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1274,10 +1274,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quote" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1369,7 +1369,7 @@ name = "relay" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1387,14 +1387,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "encoding_rs 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "libflate 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1488,27 +1488,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.22.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive_internals" -version = "0.22.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1519,7 +1519,7 @@ dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1529,7 +1529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1572,7 +1572,7 @@ dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1610,11 +1610,11 @@ dependencies = [ [[package]] name = "syn" -version = "0.12.15" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1669,7 +1669,7 @@ name = "term" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1717,16 +1717,17 @@ dependencies = [ [[package]] name = "tokio" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1736,24 +1737,24 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-executor" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1762,7 +1763,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1771,7 +1772,7 @@ name = "tokio-proto" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1788,11 +1789,11 @@ name = "tokio-reactor" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1801,7 +1802,7 @@ name = "tokio-service" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1810,7 +1811,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1819,15 +1820,24 @@ dependencies = [ [[package]] name = "tokio-threadpool" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1835,7 +1845,7 @@ name = "tokio-tls" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1847,7 +1857,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2025,7 +2035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" "checksum build_const 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e90dc84f5e62d2ebe7676b83c22d33b6db8bd27340fb6ffbff0a364efa0cb9c9" -"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" +"checksum byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b5bdfe7ee3ad0b99c9801d58807a9dbc9e09196365b0203853b99889ab3c87" "checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9" "checksum c_vec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11f56b93adbca81a4ed1bb654070013b496a9b0b259a296281f4be24af84debd" "checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" @@ -2065,7 +2075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "51f93f3de6ba1794dcd5810b3546d004600a59a98266487c8407bc4b24e398f3" -"checksum futures 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5a3176836efa0b37f0e321b86672dfada1564aeb516fbed67b7c24050a0263" +"checksum futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "1a70b146671de62ec8c8ed572219ca5d594d9b06c0b364d5e67b722fc559b48c" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" @@ -2131,7 +2141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc" -"checksum pest_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6453faedc5c9980a3c278f28b1df33344a79cc6d4a2fd96e2b56288374dc822a" +"checksum pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab94faafeb93f4c5e3ce81ca0e5a779529a602ad5d09ae6d21996bfb8b6a52bf" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" "checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f" "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" @@ -2139,11 +2149,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" "checksum pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a029430f0d744bc3d15dd474d591bed2402b645d024583082b9f63bb936dac6" -"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" +"checksum proc-macro2 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "388d7ea47318c5ccdeb9ba6312cee7d3f65dd2804be8580a170fce410d50b786" "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" "checksum quick-xml 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b14c27e04216596a49f2b82398a24f67ed9f131a5c0e0235496ea446bdacfb12" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" +"checksum quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0ff51282f28dc1b53fd154298feaa2e77c5ea0dba68e1fd8b03b72fbe13d2a" "checksum r2d2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f9078ca6a8a5568ed142083bb2f7dc9295b69d16f867ddcc9849e51b17d8db46" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" @@ -2167,9 +2177,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" "checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" "checksum send-cell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c620dd7e056b468b9d374a9f51cfa6bb4bf17a8ca4ee62e5efa0d99aaff2c41" -"checksum serde 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)" = "c70142ae874a42c70e03c63c6a49abe2ea0079b090bf6e136e99252fc1974bd6" -"checksum serde_derive 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)" = "6fffe22d41dbddcead5b2c380c4714d44f2eb39292f7e7a0d966d2d45bf56408" -"checksum serde_derive_internals 0.22.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d2f04ed291686ce195a5c8f554aaf36e50a721fbf829ee3b6151e6f85eccf945" +"checksum serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "d3bcee660dcde8f52c3765dd9ca5ee36b4bf35470a738eb0bd5a8752b0389645" +"checksum serde_derive 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "f1711ab8b208541fa8de00425f6a577d90f27bb60724d2bb5fd911314af9668f" +"checksum serde_derive_internals 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "89b340a48245bc03ddba31d0ff1709c118df90edc6adabaca4aac77aea181cce" "checksum serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "5c508584d9913df116b91505eec55610a2f5b16e9ed793c46e4d0152872b3e74" "checksum serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce0fd303af908732989354c6f02e05e2e6d597152870f2c6990efb0577137480" "checksum simplelog 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce595117de34b75e057b41e99079e43e9fcc4e5ec9c7ba5f2fea55321f0c624e" @@ -2182,7 +2192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)" = "c97c05b8ebc34ddd6b967994d5c6e9852fa92f8b82b3858c39451f97346dcce5" +"checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" @@ -2195,15 +2205,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum thread-scoped 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99" "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" "checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098" -"checksum tokio 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "65bd27f59c223e7c9e406bcdadb453e143bcf1242e162ae6c0f0eb6d14487306" +"checksum tokio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "be15ef40f675c9fe66e354d74c73f3ed012ca1aa14d65846a33ee48f1ae8d922" "checksum tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "799492ccba3d8ed5e41f2520a7cfd504cb65bbfe5fbbbd0012e335ae5f188051" -"checksum tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3aca092a94dc6e736819347a990a86ed734a6543a9d6f817929fa4dc8c4334e2" +"checksum tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8cac2a7883ff3567e9d66bb09100d09b33d90311feca0206c7ca034bc0c55113" "checksum tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6af9eb326f64b2d6b68438e1953341e00ab3cf54de7e35d92bfc73af8555313a" "checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" "checksum tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3cedc8e5af5131dc3423ffa4f877cce78ad25259a9a62de0613735a13ebc64b" "checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" "checksum tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec9b094851aadd2caf83ba3ad8e8c4ce65a42104f7b94d9e6550023f0407853f" -"checksum tokio-threadpool 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2057ff8a75d33639f9ea1b4b85cb113c7bbf4e06d132f148521d12cb6daa1a22" +"checksum tokio-threadpool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3d05cdd6a78005e535d2b27c21521bdf91fbb321027a62d8e178929d18966d" +"checksum tokio-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29a89e4ad0c8f1e4c9860e605c38c69bfdad3cccd4ea446e58ff588c1c07a397" "checksum tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" "checksum tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "137bda266504893ac4774e0ec4c2108f7ccdbcb7ac8dced6305fe9e4e0b5041a" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" diff --git a/hammond-data/Cargo.toml b/hammond-data/Cargo.toml index 73b91ec..51d87ed 100644 --- a/hammond-data/Cargo.toml +++ b/hammond-data/Cargo.toml @@ -16,7 +16,7 @@ rfc822_sanitizer = "0.3.3" rss = "1.4.0" url = "1.7.0" xdg = "2.1.0" -futures = "0.1.20" +futures = "0.1.21" hyper = "0.11.24" tokio-core = "0.1.16" hyper-tls = "0.1.3" diff --git a/hammond-downloader/Cargo.toml b/hammond-downloader/Cargo.toml index d1cb267..29a2685 100644 --- a/hammond-downloader/Cargo.toml +++ b/hammond-downloader/Cargo.toml @@ -19,4 +19,4 @@ failure_derive = "0.1.1" path = "../hammond-data" [dev-dependencies] -pretty_assertions = "0.5.1" \ No newline at end of file +pretty_assertions = "0.5.1" diff --git a/hammond-gtk/Cargo.toml b/hammond-gtk/Cargo.toml index 75d1704..42ade0c 100644 --- a/hammond-gtk/Cargo.toml +++ b/hammond-gtk/Cargo.toml @@ -42,4 +42,4 @@ path = "../hammond-data" path = "../hammond-downloader" [dev-dependencies] -pretty_assertions = "0.5.1" \ No newline at end of file +pretty_assertions = "0.5.1" From 3d9860012625595915df336410904e9977aea261 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 17:13:57 +0300 Subject: [PATCH 11/12] h-data: Sanitize html during Podcast/Episode parsing. --- Cargo.lock | 4 ++-- hammond-data/src/lib.rs | 1 + hammond-data/src/models/new_episode.rs | 7 ++++--- hammond-data/src/models/new_podcast.rs | 3 ++- hammond-gtk/Cargo.toml | 1 - hammond-gtk/src/main.rs | 1 - hammond-gtk/src/widgets/show.rs | 6 ++---- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df6c73f..46db858 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -696,7 +696,6 @@ dependencies = [ name = "hammond-gtk" version = "0.1.0" dependencies = [ - "ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -741,8 +740,9 @@ dependencies = [ [[package]] name = "html2pango" version = "0.1.0" -source = "git+https://gitlab.gnome.org/danigm/html2pango#2e55f7587a2e7d75cf3ceed814fd473d60384dd2" +source = "git+https://gitlab.gnome.org/danigm/html2pango#6dda855642d7d3cac0f1873106f2c93dc55ef293" dependencies = [ + "ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index d49d047..7d1d9e3 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -39,6 +39,7 @@ extern crate lazy_static; #[macro_use] extern crate log; +extern crate ammonia; extern crate chrono; extern crate futures; extern crate futures_cpupool; diff --git a/hammond-data/src/models/new_episode.rs b/hammond-data/src/models/new_episode.rs index a86c65b..3b25fb5 100644 --- a/hammond-data/src/models/new_episode.rs +++ b/hammond-data/src/models/new_episode.rs @@ -1,3 +1,4 @@ +use ammonia; use diesel; use diesel::prelude::*; use rfc822_sanitizer::parse_from_rfc2822_with_fallback as parse_rfc822; @@ -230,7 +231,7 @@ impl NewEpisodeMinimal { pub(crate) fn into_new_episode(self, item: &rss::Item) -> NewEpisode { let length = || -> Option { item.enclosure().map(|x| x.length().parse().ok())? }(); - let description = item.description().map(|s| s.to_owned()); + let description = item.description().map(|s| ammonia::clean(s)); NewEpisodeBuilder::default() .title(self.title) @@ -404,7 +405,7 @@ mod tests { static ref EXPECTED_LUP_1: NewEpisode = { let descr = "Audit your network with a couple of easy commands on Kali Linux. Chris \ decides to blow off a little steam by attacking his IoT devices, Wes has \ - the scope on Equifax blaming open source & the Beard just saved the \ + the scope on Equifax blaming open source & the Beard just saved the \ show. It’s a really packed episode!"; NewEpisodeBuilder::default() @@ -427,7 +428,7 @@ mod tests { concerns. But as the project takes on a new level of relevance, decisions for \ the next version of Gnome have us worried about the future.

\n\n

Plus we \ chat with Wimpy about the Ubuntu Rally in NYC, Microsoft’s sneaky move to turn \ - Windows 10 into the “ULTIMATE LINUX RUNTIME”, community news & more!

"; + Windows 10 into the “ULTIMATE LINUX RUNTIME”, community news & more!

"; NewEpisodeBuilder::default() .title("Gnome Does it Again | LUP 213") diff --git a/hammond-data/src/models/new_podcast.rs b/hammond-data/src/models/new_podcast.rs index db77cbc..e888340 100644 --- a/hammond-data/src/models/new_podcast.rs +++ b/hammond-data/src/models/new_podcast.rs @@ -1,3 +1,4 @@ +use ammonia; use diesel; use diesel::prelude::*; use rss; @@ -88,7 +89,7 @@ impl NewPodcast { pub(crate) fn new(chan: &rss::Channel, source_id: i32) -> NewPodcast { let title = chan.title().trim(); - let description = chan.description().trim(); + let description = ammonia::clean(chan.description().trim()); let link = url_cleaner(chan.link()); let itunes_img = chan.itunes_ext() .and_then(|s| s.image()) diff --git a/hammond-gtk/Cargo.toml b/hammond-gtk/Cargo.toml index 42ade0c..fde3b8f 100644 --- a/hammond-gtk/Cargo.toml +++ b/hammond-gtk/Cargo.toml @@ -6,7 +6,6 @@ version = "0.1.0" workspace = "../" [dependencies] -ammonia = "1.1.0" chrono = "0.4.1" gdk = "0.8.0" gdk-pixbuf = "0.4.0" diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 7fa4bda..276ae35 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -23,7 +23,6 @@ extern crate log; #[macro_use] extern crate pretty_assertions; -extern crate ammonia; extern crate chrono; extern crate hammond_data; extern crate hammond_downloader; diff --git a/hammond-gtk/src/widgets/show.rs b/hammond-gtk/src/widgets/show.rs index 6c38c95..bf90607 100644 --- a/hammond-gtk/src/widgets/show.rs +++ b/hammond-gtk/src/widgets/show.rs @@ -1,9 +1,8 @@ use failure::Error; // use glib; -use ammonia; use gtk; use gtk::prelude::*; -use html2pango::markup as html_to_pango_markup; +use html2pango::markup_from_raw; use open; use hammond_data::Podcast; @@ -118,8 +117,7 @@ impl ShowWidget { /// Set the descripton text. fn set_description(&self, text: &str) { - self.description - .set_markup(&ammonia::clean(&html_to_pango_markup(text))); + self.description.set_markup(&markup_from_raw(text)); } /// Set scrolled window vertical adjustment. From 916775462d8f3c17fe295e441bee65913f003bcf Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 3 Apr 2018 18:05:32 +0300 Subject: [PATCH 12/12] Update changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b2a0d3..4612fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Downlaoding and loading images now is done asynchronously and is not blocking programs execution. [#7](https://gitlab.gnome.org/alatiera/Hammond/issues/7) +* Bold, italics links and some other `html` tags can now be rendered in the Show Description. +[#25](https://gitlab.gnome.org/alatiera/Hammond/issues/25) ## [0.3.1] - 2018-03-28