From 6e71ad1a3b5df79f2ec0c8cbb5194ef1fe2c4faa Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Mon, 23 Jul 2018 17:25:31 +0530 Subject: Add deps, fix url handling --- src/content.rs | 1 - src/main.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/content.rs b/src/content.rs index a192446..d767f9c 100644 --- a/src/content.rs +++ b/src/content.rs @@ -31,7 +31,6 @@ pub fn query_url_gen(title: &str) -> String { pub fn search_url_gen(search: &str) -> String { // search config - let search = search.replace(" ", "%20"); let mut url = CONFIGURATION.wiki_url.clone(); url.push_str("/w/api.php?"); url.push_str("action=opensearch&"); diff --git a/src/main.rs b/src/main.rs index ff87931..20f2061 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,10 +66,10 @@ fn parse_arguments() -> Configuration { if matches.is_present("HELP") { std::process::exit(0); } - + let lang = matches.value_of("lang").unwrap_or("en").to_string(); let wiki_url = matches.value_of("URL").unwrap_or(&format!("https://{}.wikipedia.org", lang)).to_string(); - + Configuration { wiki_url } -- cgit v1.2.3