From a3e47effb494bd762ad966929b30721df0e8da94 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sat, 23 Sep 2017 10:12:48 +0300 Subject: [PATCH] Pre-commit cargo test and cargo fmt hook test. --- rustfmt.toml | 2 +- src/feedparser.rs | 15 +++++++-------- src/lib.rs | 4 +++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 2f0d91b..3ea68a6 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -22,6 +22,6 @@ merge_derives = true array_horizontal_layout_threshold = 5 condense_wildcard_suffixes = true # rustfmt 0.2.7 panics with format_string = true atm -# format_strings = true +# format_strings = false chain_one_line_max = 60 chain_split_single_child = false diff --git a/src/feedparser.rs b/src/feedparser.rs index 2545669..449957c 100644 --- a/src/feedparser.rs +++ b/src/feedparser.rs @@ -175,11 +175,11 @@ mod tests { let channel = Channel::read_from(BufReader::new(file)).unwrap(); let firstitem = channel.items().first().unwrap(); - let descr = "NSA whistleblower Edward Snowden discusses the massive Equifax data breach \ - and allegations of Russian interference in the US election. Commentator \ - Shaun King explains his call for a boycott of the NFL and talks about his \ - campaign to bring violent neo-Nazis to justice. Rapper Open Mike Eagle \ - performs."; + let descr = "NSA whistleblower Edward Snowden discusses the massive Equifax data \ + breach and allegations of Russian interference in the US election. \ + Commentator Shaun King explains his call for a boycott of the NFL and \ + talks about his campaign to bring violent neo-Nazis to justice. Rapper \ + Open Mike Eagle performs."; let i = parse_episode(&firstitem, 0).unwrap(); assert_eq!(i.title, Some("The Super Bowl of Racism")); @@ -305,9 +305,8 @@ mod tests { let descr2 = "

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.

- -

Plus we chat with Wimpy about the Ubuntu Rally in NYC, \ + 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!

"; assert_eq!(i2.title, Some("Gnome Does it Again | LUP 213")); diff --git a/src/lib.rs b/src/lib.rs index 501010d..5ad32c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,9 +68,11 @@ lazy_static!{ static ref HAMMOND_DATA: PathBuf = { HAMMOND_XDG.create_data_directory(HAMMOND_XDG.get_data_home()).unwrap() }; + static ref HAMMOND_CONFIG: PathBuf = { - HAMMOND_XDG.create_config_directory(HAMMOND_XDG.get_config_home()).unwrap() + HAMMOND_XDG.create_config_directory(HAMMOND_XDG.get_config_home()).unwrap() }; + static ref HAMMOND_CACHE: PathBuf = { HAMMOND_XDG.create_cache_directory(HAMMOND_XDG.get_cache_home()).unwrap() };