aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index fd01af8..85d25e7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,9 +6,7 @@ extern crate serde_json;
6extern crate lazy_static; 6extern crate lazy_static;
7 7
8use cursive::traits::*; 8use cursive::traits::*;
9use cursive::views::{ 9use cursive::views::{Dialog, DummyView, EditView, LinearLayout, OnEventView, SelectView, TextView};
10 Dialog, DummyView, EditView, LinearLayout, OnEventView, SelectView, TextView,
11};
12use cursive::Cursive; 10use cursive::Cursive;
13 11
14use serde_json::Value; 12use serde_json::Value;
@@ -83,7 +81,7 @@ fn search(s: &mut Cursive) {
83 let mut result = vec![]; 81 let mut result = vec![];
84 match get_search_results(&search) { 82 match get_search_results(&search) {
85 Ok(x) => result = x, 83 Ok(x) => result = x,
86 Err(e) => pop_error(s, handler(e)), 84 Err(e) => pop_error(s, &handler(&e)),
87 }; 85 };
88 let choose_result = SelectView::<String>::new() 86 let choose_result = SelectView::<String>::new()
89 .with_all_str(result) 87 .with_all_str(result)
@@ -132,15 +130,15 @@ fn on_submit(s: &mut Cursive, name: &str) {
132 130
133 match get_extract(&v) { 131 match get_extract(&v) {
134 Ok(x) => extract = x, 132 Ok(x) => extract = x,
135 Err(e) => pop_error(s, handler(e)), 133 Err(e) => pop_error(s, &handler(&e)),
136 }; 134 };
137 match get_links(&v) { 135 match get_links(&v) {
138 Ok(x) => link_vec = x, 136 Ok(x) => link_vec = x,
139 Err(e) => pop_error(s, handler(e)), 137 Err(e) => pop_error(s, &handler(&e)),
140 }; 138 };
141 139
142 // get the act together 140 // get the act together
143 let article_content = TextView::new(extract_formatter(extract)).scrollable(); 141 let article_content = TextView::new(extract_formatter(&extract)).scrollable();
144 142
145 let links = SelectView::<String>::new() 143 let links = SelectView::<String>::new()
146 .with_all_str(link_vec) 144 .with_all_str(link_vec)