aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2018-06-21 12:46:09 +0100
committerNerdyPepper <[email protected]>2018-06-21 12:46:09 +0100
commitaa9d82749ae45bc7c5310e1c2c901551aab65c83 (patch)
treedce54274e1cd9cd8f138cb825a867118ea30977a /src
parent81379203747a64ab9d7954c06ffb3b565980299d (diff)
Resultify all functs
Diffstat (limited to 'src')
-rw-r--r--src/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index bc1188d..9a27b0e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -9,6 +9,7 @@ use cursive::traits::*;
9use cursive::views::{TextView, Dialog, EditView, SelectView}; 9use cursive::views::{TextView, Dialog, EditView, SelectView};
10 10
11pub mod content; 11pub mod content;
12use content::*;
12 13
13fn main() { 14fn main() {
14 // Initial setup 15 // Initial setup
@@ -25,8 +26,12 @@ fn search(s: &mut Cursive){
25 26
26 fn go(s: &mut Cursive, search: &str) { 27 fn go(s: &mut Cursive, search: &str) {
27 s.pop_layer(); 28 s.pop_layer();
28 let results = content::get_search_results(search); 29 let mut result;
29 s.add_layer(SelectView::new().with_all_str(results)); 30 match get_search_results(search) {
31 Ok(x) => result = x,
32 Err(e) => pop_error(s,handler(e)),
33 };
34 let choose_result = SelectView::new().with_all_str(result);
30 } 35 }
31 36
32 s.add_layer(Dialog::around(EditView::new() 37 s.add_layer(Dialog::around(EditView::new()