aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2018-07-23 12:55:31 +0100
committerNerdyPepper <[email protected]>2018-07-23 12:55:31 +0100
commit6e71ad1a3b5df79f2ec0c8cbb5194ef1fe2c4faa (patch)
tree921effc929743688f4a4f340da009d8c8e02e9d6 /src
parentd454b4d574fd6695342a122f26bdbd25966a8f42 (diff)
Add deps, fix url handling
Diffstat (limited to 'src')
-rw-r--r--src/content.rs1
-rw-r--r--src/main.rs4
2 files changed, 2 insertions, 3 deletions
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 {
31 31
32pub fn search_url_gen(search: &str) -> String { 32pub fn search_url_gen(search: &str) -> String {
33 // search config 33 // search config
34 let search = search.replace(" ", "%20");
35 let mut url = CONFIGURATION.wiki_url.clone(); 34 let mut url = CONFIGURATION.wiki_url.clone();
36 url.push_str("/w/api.php?"); 35 url.push_str("/w/api.php?");
37 url.push_str("action=opensearch&"); 36 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 {
66 if matches.is_present("HELP") { 66 if matches.is_present("HELP") {
67 std::process::exit(0); 67 std::process::exit(0);
68 } 68 }
69 69
70 let lang = matches.value_of("lang").unwrap_or("en").to_string(); 70 let lang = matches.value_of("lang").unwrap_or("en").to_string();
71 let wiki_url = matches.value_of("URL").unwrap_or(&format!("https://{}.wikipedia.org", lang)).to_string(); 71 let wiki_url = matches.value_of("URL").unwrap_or(&format!("https://{}.wikipedia.org", lang)).to_string();
72 72
73 Configuration { 73 Configuration {
74 wiki_url 74 wiki_url
75 } 75 }